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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 927eca3e68cefb19674dbdddefeb5173d1e64312
4
- data.tar.gz: 84e720a1b995b3b06ce2031756cb5500a35d135f
2
+ SHA256:
3
+ metadata.gz: af10737fd22ee91b9043d34f50f08a54b3cd357e83614aa1453baf3b4198034e
4
+ data.tar.gz: d7db70ffe44717db773d4bee36e19453400d6138948457ef667fe5f287b2b679
5
5
  SHA512:
6
- metadata.gz: a709f010c0f0851a1026e179f1b085604eeb8f540ffbdf04b5078ff9c6f2f49104fe23500835ac76d9316d00e53bab03d455b3f14c0fd52615f504e888739f83
7
- data.tar.gz: f237223a96f1e1fea4197c9efdfea2d83b63dc756e9967d9c2cb836dcf2abcbd88d5444540062b19d1649bc481acbdd9dc9957d3b44067ce02be6ebd5acba893
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
- ignoring gem's name.
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,
@@ -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 "sdoc", "~> 0.4.1"
7
+ gem "rails", "~> 4.0"
9
8
  gem "pry", "~> 0.10.1"
10
9
  gem "pry-byebug", "~> 3.2.0"
11
- gem "sqlite3", "~> 1.3.10"
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 "rspec-rails", "~> 3.5"
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 "rubocop", "~> 0.37.2"
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
 
@@ -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 "sdoc", "~> 0.4.1"
7
+ gem "rails", "~> 5.0.0"
9
8
  gem "pry", "~> 0.10.1"
10
9
  gem "pry-byebug", "~> 3.2.0"
11
- gem "sqlite3", "~> 1.3.10"
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 "rspec-rails", "~> 3.5"
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 "rubocop", "~> 0.37.2"
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
@@ -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 "sdoc", "~> 0.4.1"
7
+ gem "rails", "~> 5.1"
9
8
  gem "pry", "~> 0.10.1"
10
9
  gem "pry-byebug", "~> 3.2.0"
11
- gem "sqlite3", "~> 1.3.10"
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 "rspec-rails", "~> 3.5"
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 "rubocop", "~> 0.37.2"
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| BigDecimal.new(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| BigDecimal.new(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
@@ -7,7 +7,7 @@ module RailsStuff
7
7
  MAJOR = 0
8
8
  MINOR = 6
9
9
  TINY = 0
10
- PRE = 'rc3'.freeze
10
+ PRE = nil
11
11
 
12
12
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
13
13
 
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.rc3
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: 2017-10-29 00:00:00.000000000 Z
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: 1.3.1
157
+ version: '0'
158
158
  requirements: []
159
159
  rubyforge_project:
160
- rubygems_version: 2.6.8
160
+ rubygems_version: 2.7.6
161
161
  signing_key:
162
162
  specification_version: 4
163
163
  summary: Collection of useful modules for Rails