hobo_support 1.4.0.pre8 → 2.0.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/hobo_support.gemspec +1 -1
- data/lib/generators/hobo_support/model.rb +5 -0
- data/lib/hobo_support/common_tasks.rb +0 -1
- data/lib/hobo_support/enumerable.rb +12 -8
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.0.0.pre1
|
data/hobo_support.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.summary = 'Core Ruby extensions from the Hobo project'
|
12
12
|
s.description = 'Core Ruby extensions from the Hobo project'
|
13
13
|
|
14
|
-
s.add_runtime_dependency('rails', ["~> 3.
|
14
|
+
s.add_runtime_dependency('rails', ["~> 3.2.0"])
|
15
15
|
s.add_development_dependency('rubydoctest', [">= 0"])
|
16
16
|
s.add_development_dependency('chronic', [">= 0"])
|
17
17
|
|
@@ -18,6 +18,7 @@ module Generators
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def inject_hobo_code_into_model_file
|
21
|
+
gsub_file(model_path, / # attr_accessible :title, :body\n/m, "")
|
21
22
|
inject_into_class model_path, class_name do
|
22
23
|
eval_template('model_injection.rb.erb')
|
23
24
|
end
|
@@ -37,6 +38,10 @@ module Generators
|
|
37
38
|
attributes.reject { |a| a.name == "bt" || a.name == "hm" }
|
38
39
|
end
|
39
40
|
|
41
|
+
def accessible_attributes
|
42
|
+
field_attributes + bts.map {|bt| bt+"_id"} + bts + hms
|
43
|
+
end
|
44
|
+
|
40
45
|
def hms
|
41
46
|
attributes.select { |a| a.name == "hm" }.*.type
|
42
47
|
end
|
@@ -25,7 +25,6 @@ namespace :test do
|
|
25
25
|
sh %(echo "" >> Gemfile)
|
26
26
|
sh %(echo "gem 'irt', :group => :development" >> Gemfile) # to make the bundler happy
|
27
27
|
sh %(echo "gem 'therubyracer'" >> Gemfile)
|
28
|
-
sh %(echo "gem 'irt', :group => :development" >> Gemfile) # to make the bundler happy
|
29
28
|
sh %(echo "" > app/models/.gitignore) # because git reset --hard would rm the dir
|
30
29
|
rm %(.gitignore) # we need to reset everything in a testapp
|
31
30
|
sh %(git init && git add . && git commit -m "initial commit")
|
@@ -60,17 +60,21 @@ module Enumerable
|
|
60
60
|
MultiSender.new(self, :reject)
|
61
61
|
end
|
62
62
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
63
|
+
unless method_defined?(:drop_while)
|
64
|
+
def drop_while
|
65
|
+
drop = 0
|
66
|
+
drop += 1 while yield(self[drop])
|
67
|
+
self[drop..-1]
|
68
|
+
end
|
67
69
|
end
|
68
70
|
|
69
71
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
72
|
+
unless method_defined?(:take_while)
|
73
|
+
def take_while
|
74
|
+
take = 0
|
75
|
+
take += 1 while yield(self[take])
|
76
|
+
self[0..take-1]
|
77
|
+
end
|
74
78
|
end
|
75
79
|
|
76
80
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hobo_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.pre1
|
5
5
|
prerelease: 6
|
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-
|
12
|
+
date: 2012-09-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 3.
|
21
|
+
version: 3.2.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 3.
|
29
|
+
version: 3.2.0
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: rubydoctest
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|