% gem push hola-0.0.0.gem
Enter your RubyGems.org credentials.
Don't have an account yet?
Create one at http://rubygems.org/sign_up
Email: [email protected]
Password:
Signed in.
Pushing gem to RubyGems.org...
Successfully registered gem: hola (0.0.0)
Wednesday, May 25, 2011
Slide 64
Slide 64 text
push
install
build
LOCAL
REMOTE
install list -r
Wednesday, May 25, 2011
% cat bin/hola
#!/usr/bin/env ruby
require 'hola'
puts Hola.hi(ARGV[0])
“Probably derived from “shell bang” under the influence of
American slang “the whole shebang” (everything, the works)”
http://www.retrologic.com/jargon/S/shebang.html
(shə-băng')
Wednesday, May 25, 2011
Slide 73
Slide 73 text
% cat bin/hola
#!/usr/bin/env ruby
require 'hola'
puts Hola.hi(ARGV[0])
(shə-băng')
“Probably derived from “shell bang” under the influence of
American slang “the whole shebang” (everything, the works)”
http://www.retrologic.com/jargon/S/shebang.html
Wednesday, May 25, 2011
Test your gem.
Use whatever.
Please test it.
Wednesday, May 25, 2011
Slide 83
Slide 83 text
http://test.rubygems.org
Wednesday, May 25, 2011
Slide 84
Slide 84 text
Wednesday, May 25, 2011
Slide 85
Slide 85 text
% cat Rakefile
require 'rake/testtask'
Rake::TestTask.new do |t|
t.libs << 'test'
end
desc "Run tests"
task :default => :test
Wednesday, May 25, 2011
Slide 86
Slide 86 text
% cat test/test_hola.rb
require 'test/unit'
require 'hola'
class HolaTest < Test::Unit::TestCase
def test_default_hello
assert_equal "Hello world!",
Hola.hi
end
def test_custom_hello
assert_equal "Hello Boston!",
Hola.hi("Boston")
end
end
Wednesday, May 25, 2011
Slide 87
Slide 87 text
% rake test
(in /Users/qrush/Dev/ruby/hola)
Loaded suite
Started
..
Finished in 0.000736 seconds.
2 tests, 2 assertions, 0 failures,
0 errors, 0 skips
Test run options: --seed 15331
Wednesday, May 25, 2011
Slide 88
Slide 88 text
tests
executable
first gem
docs
Wednesday, May 25, 2011
Slide 89
Slide 89 text
Others will use your gem.
Write about it.
Wednesday, May 25, 2011
Slide 90
Slide 90 text
At least have a README!
Wednesday, May 25, 2011
Slide 91
Slide 91 text
http://twitter.com/rubygems
Wednesday, May 25, 2011
Slide 92
Slide 92 text
inline
guides
Wednesday, May 25, 2011
Slide 93
Slide 93 text
inline
guides
nokogiri
yard
Wednesday, May 25, 2011
Slide 94
Slide 94 text
inline
guides
nokogiri
yard
rails
datamapper
Wednesday, May 25, 2011
Slide 95
Slide 95 text
# The main Hola driver
class Hola
# Say hi to the world!
#
# Example:
# >> Hola.hi("Buffalo")
# => Hello Buffalo!
#
# Arguments:
# message: (String)
def self.hi(message = "world")
puts "Hello #{message}!"
end
end
Wednesday, May 25, 2011
Gem::Specification.new do |s|
s.name = "hola"
s.version = "2.0.0"
s.add_runtime_dependency(
"daemons", ["= 1.1.0"])
s.add_development_dependency(
"rspec", [">= 2.0.0"])
Exact
This one works for me!
Wednesday, May 25, 2011
Slide 125
Slide 125 text
Gem::Specification.new do |s|
s.name = "hola"
s.version = "2.0.0"
s.add_runtime_dependency(
"daemons", ["= 1.1.0"])
s.add_development_dependency(
"rspec", [">= 2.2.0"])
Optimistic
It will always work!
Wednesday, May 25, 2011
Slide 126
Slide 126 text
Gem::Specification.new do |s|
s.name = "hola"
s.version = "2.0.0"
s.add_runtime_dependency(
"daemons", ["= 1.1.0"])
s.add_development_dependency(
"rspec", [">= 2.2.0", "< 3.0.0"])
Pessimistic
This and future minor releases work
Wednesday, May 25, 2011
Slide 127
Slide 127 text
Gem::Specification.new do |s|
s.name = "hola"
s.version = "2.0.0"
s.add_runtime_dependency(
"daemons", ["= 1.1.0"])
s.add_development_dependency(
"rspec", ["~> 2.2"])
Pessimistic
Use the twiddle-wakka!
Wednesday, May 25, 2011
Slide 128
Slide 128 text
releasing a gem
is easy!
Wednesday, May 25, 2011
Slide 129
Slide 129 text
have a sane
versioning scheme
Wednesday, May 25, 2011
Slide 130
Slide 130 text
MAKE
MANUALS
Wednesday, May 25, 2011
Slide 131
Slide 131 text
T H X
Thanks for listening!
Big thanks to:
thoughtbot
Jeremy Hinegardner
Nick Quaranto
@qrush [email protected]
http://guides.rubygems.org
Wednesday, May 25, 2011