rails_stuff 0.6.0.rc3 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +1 -1
- data/gemfiles/rails_4.gemfile +9 -9
- data/gemfiles/rails_5_0.gemfile +9 -9
- data/gemfiles/rails_5_1.gemfile +9 -9
- data/lib/rails_stuff/params_parser.rb +11 -2
- data/lib/rails_stuff/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: af10737fd22ee91b9043d34f50f08a54b3cd357e83614aa1453baf3b4198034e
|
4
|
+
data.tar.gz: d7db70ffe44717db773d4bee36e19453400d6138948457ef667fe5f287b2b679
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7f424682270b304c5667eb5e44fa165d702cb12d72303f9ce7ff5a998a9550b94f12d6f7b008b4e00f13413e8febefb8e33ea821cd553f35322b1faca3d8c4a
|
7
|
+
data.tar.gz: f039e3a910544a49deba234ec54a6de96bd9fa6bea116dc0ba1022154038f62a6bcbd26be8bb59d575f5d265a1c3150d69cbca8fd8a2fe5bdcd96097d890e672
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Collection of useful modules for ruby projects to provide great DRY, TDD experience.
|
7
7
|
While some of them are Rails-specific, most will work in any environment
|
8
|
-
|
8
|
+
despite gem's name.
|
9
9
|
|
10
10
|
All modules are lazy loaded, so it's ok to require whole gem at once.
|
11
11
|
Some of them are activated by default for best experience,
|
data/gemfiles/rails_4.gemfile
CHANGED
@@ -3,22 +3,22 @@
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
5
|
group :development do
|
6
|
-
gem "rails", "~> 4.0"
|
7
6
|
gem "appraisal", "~> 2.1.0"
|
8
|
-
gem "
|
7
|
+
gem "rails", "~> 4.0"
|
9
8
|
gem "pry", "~> 0.10.1"
|
10
9
|
gem "pry-byebug", "~> 3.2.0"
|
11
|
-
gem "
|
12
|
-
gem "database_cleaner", "~> 1.5.0"
|
13
|
-
gem "pooled_redis", "~> 0.2.1"
|
10
|
+
gem "sdoc", "~> 0.4.1"
|
14
11
|
gem "activemodel_translation", "~> 0.1.0"
|
12
|
+
gem "database_cleaner", "~> 1.5.0"
|
15
13
|
gem "has_scope", "~> 0.7.0"
|
16
|
-
gem "responders", "~> 2.1"
|
17
|
-
gem "kaminari", "~> 0.16.3"
|
18
14
|
gem "hashie", "~> 3.4.0"
|
19
|
-
gem "
|
15
|
+
gem "kaminari", "~> 0.16.3"
|
16
|
+
gem "pooled_redis", "~> 0.2.1"
|
17
|
+
gem "responders", "~> 2.1"
|
18
|
+
gem "sqlite3", "~> 1.3.10"
|
20
19
|
gem "rspec-its", "~> 1.2.0"
|
21
|
-
gem "
|
20
|
+
gem "rspec-rails", "~> 3.5"
|
21
|
+
gem "rubocop", "~> 0.51.0"
|
22
22
|
gem "coveralls", "~> 0.8.2", :require => false
|
23
23
|
end
|
24
24
|
|
data/gemfiles/rails_5_0.gemfile
CHANGED
@@ -3,22 +3,22 @@
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
5
|
group :development do
|
6
|
-
gem "rails", "~> 5.0.0"
|
7
6
|
gem "appraisal", "~> 2.1.0"
|
8
|
-
gem "
|
7
|
+
gem "rails", "~> 5.0.0"
|
9
8
|
gem "pry", "~> 0.10.1"
|
10
9
|
gem "pry-byebug", "~> 3.2.0"
|
11
|
-
gem "
|
12
|
-
gem "database_cleaner", "~> 1.5.0"
|
13
|
-
gem "pooled_redis", "~> 0.2.1"
|
10
|
+
gem "sdoc", "~> 0.4.1"
|
14
11
|
gem "activemodel_translation", "~> 0.1.0"
|
12
|
+
gem "database_cleaner", "~> 1.5.0"
|
15
13
|
gem "has_scope", "~> 0.7.0"
|
16
|
-
gem "responders", "~> 2.1"
|
17
|
-
gem "kaminari", "~> 0.16.3"
|
18
14
|
gem "hashie", "~> 3.4.0"
|
19
|
-
gem "
|
15
|
+
gem "kaminari", "~> 0.16.3"
|
16
|
+
gem "pooled_redis", "~> 0.2.1"
|
17
|
+
gem "responders", "~> 2.1"
|
18
|
+
gem "sqlite3", "~> 1.3.10"
|
20
19
|
gem "rspec-its", "~> 1.2.0"
|
21
|
-
gem "
|
20
|
+
gem "rspec-rails", "~> 3.5"
|
21
|
+
gem "rubocop", "~> 0.51.0"
|
22
22
|
gem "coveralls", "~> 0.8.2", :require => false
|
23
23
|
gem "rails-controller-testing", "~> 0.1.1"
|
24
24
|
end
|
data/gemfiles/rails_5_1.gemfile
CHANGED
@@ -3,22 +3,22 @@
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
5
|
group :development do
|
6
|
-
gem "rails", "~> 5.1"
|
7
6
|
gem "appraisal", "~> 2.1.0"
|
8
|
-
gem "
|
7
|
+
gem "rails", "~> 5.1"
|
9
8
|
gem "pry", "~> 0.10.1"
|
10
9
|
gem "pry-byebug", "~> 3.2.0"
|
11
|
-
gem "
|
12
|
-
gem "database_cleaner", "~> 1.5.0"
|
13
|
-
gem "pooled_redis", "~> 0.2.1"
|
10
|
+
gem "sdoc", "~> 0.4.1"
|
14
11
|
gem "activemodel_translation", "~> 0.1.0"
|
12
|
+
gem "database_cleaner", "~> 1.5.0"
|
15
13
|
gem "has_scope", "~> 0.7.0"
|
16
|
-
gem "responders", "~> 2.1"
|
17
|
-
gem "kaminari", "~> 0.16.3"
|
18
14
|
gem "hashie", "~> 3.4.0"
|
19
|
-
gem "
|
15
|
+
gem "kaminari", "~> 0.16.3"
|
16
|
+
gem "pooled_redis", "~> 0.2.1"
|
17
|
+
gem "responders", "~> 2.1"
|
18
|
+
gem "sqlite3", "~> 1.3.10"
|
20
19
|
gem "rspec-its", "~> 1.2.0"
|
21
|
-
gem "
|
20
|
+
gem "rspec-rails", "~> 3.5"
|
21
|
+
gem "rubocop", "~> 0.51.0"
|
22
22
|
gem "coveralls", "~> 0.8.2", :require => false
|
23
23
|
gem "rails-controller-testing", "~> 0.1.1"
|
24
24
|
end
|
@@ -110,12 +110,12 @@ module RailsStuff
|
|
110
110
|
|
111
111
|
# Parse decimal value.
|
112
112
|
def parse_decimal(val)
|
113
|
-
parse(val) { |x|
|
113
|
+
parse(val) { |x| string_to_decimal(x) }
|
114
114
|
end
|
115
115
|
|
116
116
|
# Parses array of decimals. Returns `nil` if `val` is not an array.
|
117
117
|
def parse_decimal_array(val)
|
118
|
-
parse_array(val) { |x|
|
118
|
+
parse_array(val) { |x| string_to_decimal(x) }
|
119
119
|
end
|
120
120
|
|
121
121
|
# Parse boolean using ActiveResord's parser.
|
@@ -145,5 +145,14 @@ module RailsStuff
|
|
145
145
|
def parse_json(val)
|
146
146
|
parse(val) { JSON.parse(val) }
|
147
147
|
end
|
148
|
+
|
149
|
+
private
|
150
|
+
|
151
|
+
# Workaround for https://github.com/ruby/bigdecimal/issues/63
|
152
|
+
def string_to_decimal(val)
|
153
|
+
BigDecimal.new(val)
|
154
|
+
rescue ArgumentError
|
155
|
+
BigDecimal.new(0)
|
156
|
+
end
|
148
157
|
end
|
149
158
|
end
|
data/lib/rails_stuff/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_stuff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.0
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Melentiev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -152,12 +152,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
152
152
|
version: '0'
|
153
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
154
|
requirements:
|
155
|
-
- - "
|
155
|
+
- - ">="
|
156
156
|
- !ruby/object:Gem::Version
|
157
|
-
version:
|
157
|
+
version: '0'
|
158
158
|
requirements: []
|
159
159
|
rubyforge_project:
|
160
|
-
rubygems_version: 2.6
|
160
|
+
rubygems_version: 2.7.6
|
161
161
|
signing_key:
|
162
162
|
specification_version: 4
|
163
163
|
summary: Collection of useful modules for Rails
|