lib/generators/eotb/eotb_generator.rb in eotb-0.5.7 vs lib/generators/eotb/eotb_generator.rb in eotb-0.5.8
- old
+ new
@@ -1,13 +1,13 @@
require 'rails/generators'
class EotbGenerator < Rails::Generators::Base
desc "Creates eotb initializer in confing/initializers/eotb.rb, setting your app to work with Beholder."
+
+ source_root File.expand_path('../../../../generators/eotb/templates', __FILE__)
- source_root File.expand_path('../templates', __FILE__)
-
class_option :api_key, :aliases => "-k", :type => :string, :desc => "Your Beholder API key"
class_option :events, :aliases => "-e",:type => :numeric, :desc => "Number of events sent in one package to Beholder", :default => "1"
def generator
ensure_parameters_was_set
@@ -24,13 +24,13 @@
puts "Configuration file already exists: config/initializers/eotb.rb"
exit
end
end
- def api_key
+ def api_key_exp
"#{options[:api_key]}"
end
- def events
+ def events_exp
s = if options[:events]
"#{options[:events]}"
else
"1"
end