arcane 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
File without changes
@@ -10,3 +10,8 @@ rvm:
10
10
  gemfile:
11
11
  - gemfiles/rails3.gemfile
12
12
  - gemfiles/rails4.gemfile
13
+
14
+ matrix:
15
+ exclude:
16
+ - rvm: 1.9.2
17
+ gemfile: gemfiles/rails4.gemfile
@@ -1,4 +1,10 @@
1
- ### Arcane **1.1.0** [head][current] - 2013-07-17
1
+ ### Arcane **1.1.1** [head][current] - 2013-07-17
2
+ * **[bugfix]** Handle nil paramaters params as
3
+ @caulfield suggested in pull request #7. Thank you.
4
+ This doesn't break any functionality other than expecting
5
+ nil to return an error on use of nil parameters.
6
+
7
+ ### Arcane **1.1.0** - 2013-07-17
2
8
  * **[bugfix]** Fixed dependency hell for rails 4.
3
9
  Makde sure strong_parameters is optional. Upgrading
4
10
  to this will break compatability with rails 3 unless
data/Gemfile CHANGED
@@ -1,2 +1,5 @@
1
1
  source 'https://rubygems.org'
2
+
3
+ gem 'coveralls', :require => false
4
+
2
5
  gemspec # Specify your gem's dependencies in arcane.gemspec
data/README.md CHANGED
@@ -1,7 +1,10 @@
1
1
  # Arcane
2
2
 
3
3
  [![Build Status](https://travis-ci.org/cloudsdaleapp/arcane.png?branch=master)](https://travis-ci.org/cloudsdaleapp/arcane)
4
+ [![Coverage Status](https://coveralls.io/repos/cloudsdaleapp/arcane/badge.png)](https://coveralls.io/r/cloudsdaleapp/arcane)
5
+ [![Code Climate](https://codeclimate.com/repos/51e6d15913d6373751014a5a/badges/c2f7e13ed4e4f06be966/gpa.png)](https://codeclimate.com/repos/51e6d15913d6373751014a5a/feed)
4
6
  [![Gem Version](https://badge.fury.io/rb/arcane.png)](http://badge.fury.io/rb/arcane)
7
+ [![Dependency Status](https://gemnasium.com/cloudsdaleapp/arcane.png)](https://gemnasium.com/cloudsdaleapp/arcane)
5
8
 
6
9
  Easy to use parameter management, extending [Strong Parameters](https://github.com/rails/strong_parameters),
7
10
  making them a first class citizen. Arcane provides you with helpers which guide you in leveraging regular
@@ -1,5 +1,7 @@
1
1
  source "https://rubygems.org"
2
2
 
3
+ gem 'coveralls', :require => false
4
+
3
5
  gem "activesupport", "~> 3.2.13"
4
6
  gem "actionpack", "~> 3.2.13"
5
7
  gem "strong_parameters", "~> 0.2.0"
@@ -1,5 +1,7 @@
1
1
  source "https://rubygems.org"
2
2
 
3
+ gem 'coveralls', :require => false
4
+
3
5
  gem "activesupport", "~> 4.0.0"
4
6
  gem "actionpack", "~> 4.0.0"
5
7
 
@@ -40,7 +40,11 @@ module Arcane
40
40
  end
41
41
 
42
42
  def params=(val)
43
- @_params = val.kind_of?(Hash) ? ActionController::Parameters.new(val).as(current_params_user) : val.as(current_params_user)
43
+ @_params = if Hash === val
44
+ ActionController::Parameters.new(val).as(current_params_user)
45
+ else
46
+ val.respond_to?(:as) ? val.as(current_params_user) : val
47
+ end
44
48
  end
45
49
 
46
50
  end
@@ -74,4 +74,4 @@ module Arcane
74
74
 
75
75
  end
76
76
 
77
- ActionController::Parameters.send :include, Arcane::Parameters
77
+ ActionController::Parameters.send :include, Arcane::Parameters
@@ -1,3 +1,3 @@
1
1
  module Arcane
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -14,10 +14,22 @@ describe Arcane do
14
14
  end
15
15
 
16
16
  describe '#params=' do
17
- it 'sets the user for parameters' do
18
- controller.params = { foo: :bar }
19
- controller.instance_variable_get(:@_params).user.should eq user
17
+ context 'sets the user for' do
18
+ it 'hash parameters' do
19
+ controller.params = { foo: :bar }
20
+ controller.instance_variable_get(:@_params).user.should eq user
21
+ end
22
+
23
+ it 'ActionController::Parameters parameters' do
24
+ controller.params = ActionController::Parameters.new({ foo: :bar })
25
+ controller.instance_variable_get(:@_params).user.should eq user
26
+ end
27
+ end
28
+
29
+ it 'handles nil' do
30
+ controller.params = nil
31
+ controller.instance_variable_get(:@_params).should be_nil
20
32
  end
21
33
  end
22
34
 
23
- end
35
+ end
@@ -1,3 +1,7 @@
1
+ require 'coveralls'
2
+
3
+ Coveralls.wear!
4
+
1
5
  require "arcane"
2
6
  require "pry"
3
7
  require "active_support/core_ext"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arcane
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-07-17 00:00:00.000000000 Z
13
+ date: 2013-08-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -128,6 +128,7 @@ executables: []
128
128
  extensions: []
129
129
  extra_rdoc_files: []
130
130
  files:
131
+ - .coveralls.yml
131
132
  - .gitignore
132
133
  - .rspec
133
134
  - .travis.yml
@@ -168,18 +169,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
168
169
  - - ! '>='
169
170
  - !ruby/object:Gem::Version
170
171
  version: '0'
171
- segments:
172
- - 0
173
- hash: 852660148027280947
174
172
  required_rubygems_version: !ruby/object:Gem::Requirement
175
173
  none: false
176
174
  requirements:
177
175
  - - ! '>='
178
176
  - !ruby/object:Gem::Version
179
177
  version: '0'
180
- segments:
181
- - 0
182
- hash: 852660148027280947
183
178
  requirements: []
184
179
  rubyforge_project:
185
180
  rubygems_version: 1.8.25
@@ -192,3 +187,4 @@ test_files:
192
187
  - spec/arcane/refinery_spec.rb
193
188
  - spec/arcane_spec.rb
194
189
  - spec/spec_helper.rb
190
+ has_rdoc: