action_widget 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
data/action_widget.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
|
|
10
10
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
11
11
|
gem.name = "action_widget"
|
12
12
|
gem.require_paths = ["lib"]
|
13
|
-
gem.version = "0.3.
|
13
|
+
gem.version = "0.3.1"
|
14
14
|
|
15
15
|
gem.add_dependency 'smart_properties', '~> 1.1'
|
16
16
|
end
|
@@ -11,19 +11,17 @@ module ActionWidget
|
|
11
11
|
|
12
12
|
end
|
13
13
|
|
14
|
-
class
|
14
|
+
class Widget < Base
|
15
15
|
source_root File.expand_path('../../../../../support/templates', __FILE__)
|
16
16
|
argument :widget_name, :type => :string
|
17
17
|
class_option :rspec, :type => :boolean, :default => true, :description => "Generates rspec file"
|
18
18
|
|
19
19
|
def generate_widget_implementation_file
|
20
|
-
empty_directory 'app/widgets'
|
21
20
|
template('widget.rb.erb', "app/widgets/#{widget_implementation_filename}")
|
22
21
|
end
|
23
22
|
|
24
23
|
def generate_widget_spec_file
|
25
24
|
if defined?(::RSpec) && options.rspec?
|
26
|
-
empty_directory 'spec/widgets'
|
27
25
|
template('widget_spec.rb.erb', "spec/widgets/#{widget_spec_filename}")
|
28
26
|
end
|
29
27
|
end
|
@@ -39,7 +37,13 @@ module ActionWidget
|
|
39
37
|
end
|
40
38
|
|
41
39
|
def widget_class_name
|
42
|
-
/[Ww]idget$/.match(widget_name) ? widget_name
|
40
|
+
name = /[Ww]idget$/.match(widget_name) ? widget_name : "#{widget_name}Widget"
|
41
|
+
|
42
|
+
name = name.titleize
|
43
|
+
name = name.gsub(" ", '')
|
44
|
+
name = name.gsub("/", '::')
|
45
|
+
|
46
|
+
name
|
43
47
|
end
|
44
48
|
|
45
49
|
def widget_helper_name
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: action_widget
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: smart_properties
|