Class: Dopstick::Generator::Gem::Options
- Inherits:
-
Options
- Object
- Options
- Dopstick::Generator::Gem::Options
show all
- Defined in:
- lib/dopstick/generator/gem/options.rb
Instance Method Summary
collapse
Methods inherited from Options
#[], #github_url, #github_user, #initialize, #merge, #method_missing, #paypal_user, #respond_to_missing?, #skip_install?, #user_email, #user_name
Instance Method Details
#active_record? ⇒ Boolean
11
12
13
|
# File 'lib/dopstick/generator/gem/options.rb', line 11
def active_record?
@options[:active_record]
end
|
#bin? ⇒ Boolean
7
8
9
|
# File 'lib/dopstick/generator/gem/options.rb', line 7
def bin?
!@options[:bin].empty?
end
|
#namespace_names ⇒ Object
15
16
17
|
# File 'lib/dopstick/generator/gem/options.rb', line 15
def namespace_names
@namespace_names ||= @options[:namespace].split("::")
end
|
#namespace_size ⇒ Object
19
20
21
|
# File 'lib/dopstick/generator/gem/options.rb', line 19
def namespace_size
@namespace_size ||= namespace_names.size
end
|
#oldest_ruby_version ⇒ Object
23
24
25
26
27
28
29
30
|
# File 'lib/dopstick/generator/gem/options.rb', line 23
def oldest_ruby_version
version = ruby_versions
.map {|v| ::Gem::Version.new(v) }
.min
.canonical_segments
[*version, 0].take(3).join(".")
end
|