morfo 0.5.1 → 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
2
  SHA1:
3
- metadata.gz: 3dacdb6d0f61b40610a10e7c98846c1a9cf80112
4
- data.tar.gz: 02281f2f9f9c33335c12acb90e511e3351724f3e
3
+ metadata.gz: 7648a07af68be99b680d1934f0e50e547bd5c7f7
4
+ data.tar.gz: 854a69a7cd5841cd2ccfb92268c34a06c2098e02
5
5
  SHA512:
6
- metadata.gz: 4d25e176a5594b68a1f6d9a0813da091963da55ff3f77e5dd5bfca0f12e7219cfb7a6778c92ccb389bf3d11f1fac0e45da4c65ac65e3d55e5c0781393c744274
7
- data.tar.gz: 01153864d73f8c816c56a389af3f45fa6da76dc68d6e1b4780f21895b0d80b8e835cbc67ab9364c78ee97e5ce3a87f3ec4ced4e894156147595cfc7bb05aa161
6
+ metadata.gz: 591c1bfa68847887bc2f34d21a586132cd84e853dc8651a5d5c86aaff6a7f8bcaeb104fb1c90ac6623eec6814f93d8873fe9edbde126b4d3bf4ae889361f9add
7
+ data.tar.gz: debde19fa3a8a6278760876cfa89a9c6b52b984af6aaf68676b30fabf55c1c6e34a73ea726bfd86dc4ef6c68484bc6eb36a71e6918bf26a43f7d02d92b75680b
@@ -1,21 +1,22 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  cache: bundler
4
- env: JRUBY_OPTS=--2.0
5
4
  rvm:
6
5
  - 2.0.0
7
- - 2.1.7
8
- - 2.2.3
9
- - jruby-1.7.22
10
- - jruby-9.0.3.0
6
+ - 2.1.8
7
+ - 2.2.4
8
+ - 2.3.0
9
+ - jruby-9.0.5.0
11
10
  - ruby-head
12
11
  - jruby-head
13
- - rbx-2.2.9
12
+ - rbx-2.11
13
+ - rbx-3.14
14
14
  matrix:
15
15
  fast_finish: true
16
16
  allow_failures:
17
17
  - rvm: ruby-head
18
18
  - rvm: jruby-head
19
- - rvm: rbx-2.2.3
19
+ - rvm: rbx-2.11
20
+ - rvm: rbx-3.14
20
21
  script:
21
- - bundle exec rake spec
22
+ - bundle exec rspec
data/README.md CHANGED
@@ -180,7 +180,7 @@ class AndZombies < Morfo::Base
180
180
  end
181
181
 
182
182
  morfer = Morfo::Builder.new([
183
- { field: :title, from: :title, transformed: "%{title} and Zombies" },
183
+ { field: :title, from: :title, transformed: "%{value} and Zombies" },
184
184
  ])
185
185
 
186
186
  morfer.morf([
@@ -3,6 +3,7 @@ require "morfo/version"
3
3
  require "morfo/tools"
4
4
  require "morfo/actions"
5
5
  require "morfo/builder"
6
+ require "morfo/errors"
6
7
 
7
8
  module Morfo
8
9
  class Base
@@ -22,7 +22,7 @@ module Morfo
22
22
  end
23
23
 
24
24
  def execute row
25
- raise ArgumentError,
25
+ raise Morfo::NoSourceFieldError,
26
26
  "No field to get value from is specified for #{field_path.inspect}"
27
27
  end
28
28
  end
@@ -0,0 +1,4 @@
1
+ module Morfo
2
+ class StandardError < ::StandardError; end
3
+ class NoSourceFieldError < StandardError; end
4
+ end
@@ -1,3 +1,3 @@
1
1
  module Morfo
2
- VERSION = "0.5.1"
2
+ VERSION = "0.6.0"
3
3
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_dependency "rake"
22
22
  spec.add_dependency "json"
23
- spec.add_dependency "activesupport", ">= 3.2"
23
+ spec.add_dependency "activesupport", "< 5.1"
24
24
  spec.add_dependency "rubysl" if RUBY_ENGINE == "rbx"
25
25
 
26
26
  spec.add_development_dependency "bundler", "~> 1.3"
@@ -3,13 +3,13 @@ shared_examples "an error throwing morfer" do
3
3
 
4
4
  describe "#morf" do
5
5
  it "raises error for nil field" do
6
- expect{no_from.morf([{my_field: :something}])}.to raise_error(ArgumentError)
6
+ expect{no_from.morf([{my_field: :something}])}.to raise_error(Morfo::NoSourceFieldError)
7
7
  end
8
8
  end
9
9
 
10
10
  describe "#morf_single" do
11
11
  it "raises error for nil field" do
12
- expect{no_from.morf_single({my_field: :something})}.to raise_error(ArgumentError)
12
+ expect{no_from.morf_single({my_field: :something})}.to raise_error(Morfo::NoSourceFieldError)
13
13
  end
14
14
  end
15
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: morfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leif Gensert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-26 00:00:00.000000000 Z
11
+ date: 2016-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: activesupport
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "<"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.2'
47
+ version: '5.1'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "<"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.2'
54
+ version: '5.1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -107,6 +107,7 @@ files:
107
107
  - lib/morfo.rb
108
108
  - lib/morfo/actions.rb
109
109
  - lib/morfo/builder.rb
110
+ - lib/morfo/errors.rb
110
111
  - lib/morfo/tools.rb
111
112
  - lib/morfo/version.rb
112
113
  - morfo.gemspec
@@ -136,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
137
  version: '0'
137
138
  requirements: []
138
139
  rubyforge_project:
139
- rubygems_version: 2.4.5.1
140
+ rubygems_version: 2.5.1
140
141
  signing_key:
141
142
  specification_version: 4
142
143
  summary: Inspired by ActiveImporter, this gem generically converts an array of hashes