Skip to content

Commit

Permalink
Fix delegators
Browse files Browse the repository at this point in the history
  • Loading branch information
bootstraponline committed Aug 4, 2014
1 parent 494e083 commit a68604a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ end
--:|:--
gem_name | must be provided
github_owner | `appium`
github_name | gem_name
github_name | `#{gem_name}`
version_file | `lib/#{gem_name}/version.rb`
docs_block | no docs are generated

Expand Down
7 changes: 4 additions & 3 deletions lib/appium_thor/commands/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
class Default < Thor
desc 'info', 'prints config info for this gem'
def info
puts " gem_name: #{gem_name}\n" +
" github_name: #{github_name}\n" +
"version_file: #{version_file}"
puts " gem_name: #{gem_name}\n" +
" github_name: #{github_name}\n" +
" github_owner: #{github_owner}\n"
" version_file: #{version_file}"
end

desc 'bumpx', 'Bump the x version number, set y & z to zero, update the date.'
Expand Down
12 changes: 11 additions & 1 deletion lib/appium_thor/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,17 @@ def docs_block &block
@docs_block = block
end

%w[gem_name github_name github_owner version_file].each do |option|
# Returns all options as symbols. Required for defining delegators in init.rb
def options
string_options + [:docs_block]
end

# the subset of options that operate on strings
def string_options
%w[gem_name github_name github_owner version_file].map(&:to_sym)
end

string_options.each do |option|
class_eval %Q(
def #{option} string=nil
return @#{option} if @#{option}
Expand Down

0 comments on commit a68604a

Please sign in to comment.