amorail 0.3.1 → 0.3.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 736fcfcfe01b4a1d43dcb948109682efcc1ac3ae
4
- data.tar.gz: efdb851a51c2864f5d8b55bbf6e6990779b4cd87
3
+ metadata.gz: 8e253f1e56792978fb0a62a879cb4e664e541cbf
4
+ data.tar.gz: 194bf0bd46984a0412dc698016ae3193912fe68e
5
5
  SHA512:
6
- metadata.gz: 4885334ef53b0023f700a32c81bb56c41b94e3e8d83e1001a812475b9fe409a8246e5a9f47ff1ae7279a369be9f7177e0c27db0dd86a4f20bfb224ee65b88e84
7
- data.tar.gz: a5cb5bca3728f73fb01400aa868c95d092b17b79c128bc7ef483e373a6412415fc0c1a7cca971c437de53ecba274da1e9b383986566df5c2a13edf5697bc4d0a
6
+ metadata.gz: 8ebd35962ff10305089e74387e24647064f65915de5b4f91dbf69df02fabe110f64ad982a9c47d39b88ee5762ac0534282ea9d8341e217035daf38b00a433bb4
7
+ data.tar.gz: 1f3d42de192b1e09dfc8aa6515da4a2476907b6ed776820b9d1d079050b153f96923512660745f03112fe6a8f1c63dedbc80401cd2ca0b44ee7e83b805a6dc7c
@@ -44,5 +44,5 @@ module Amorail
44
44
  attr_accessor :client
45
45
  end
46
46
 
47
- require 'amorail/engine' if defined?(Rails)
47
+ require 'amorail/railtie' if defined?(Rails)
48
48
  end
@@ -17,11 +17,7 @@ module Amorail # :nodoc: all
17
17
  end
18
18
 
19
19
  def save!
20
- if save
21
- true
22
- else
23
- fail InvalidRecord
24
- end
20
+ save || fail(InvalidRecord)
25
21
  end
26
22
 
27
23
  def update(attrs = {})
@@ -31,11 +27,7 @@ module Amorail # :nodoc: all
31
27
  end
32
28
 
33
29
  def update!(attrs = {})
34
- if update(attrs)
35
- true
36
- else
37
- fail NotPersisted
38
- end
30
+ update(attrs) || fail(NotPersisted)
39
31
  end
40
32
 
41
33
  def reload
@@ -0,0 +1,7 @@
1
+ module Amorail
2
+ class Railtie < Rails::Railtie
3
+ rake_tasks do
4
+ load File.expand_path('../../tasks/amorail.rake', __FILE__)
5
+ end
6
+ end
7
+ end
@@ -1,4 +1,4 @@
1
1
  # Amorail version
2
2
  module Amorail
3
- VERSION = "0.3.1".freeze
3
+ VERSION = "0.3.3".freeze
4
4
  end
@@ -1,8 +1,6 @@
1
- require 'amorail'
2
-
3
1
  namespace :amorail do
4
- desc "Check Amorail configuration."
2
+ desc 'Check Amorail configuration'
5
3
  task :check do
6
- p Amorail.properties.inspect
4
+ puts Amorail.properties.inspect
7
5
  end
8
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amorail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - alekseenkoss
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-06-19 00:00:00.000000000 Z
12
+ date: 2017-07-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -191,7 +191,6 @@ files:
191
191
  - lib/amorail.rb
192
192
  - lib/amorail/client.rb
193
193
  - lib/amorail/config.rb
194
- - lib/amorail/engine.rb
195
194
  - lib/amorail/entities/company.rb
196
195
  - lib/amorail/entities/contact.rb
197
196
  - lib/amorail/entities/contact_link.rb
@@ -204,6 +203,7 @@ files:
204
203
  - lib/amorail/entity/persistance.rb
205
204
  - lib/amorail/exceptions.rb
206
205
  - lib/amorail/property.rb
206
+ - lib/amorail/railtie.rb
207
207
  - lib/amorail/version.rb
208
208
  - lib/tasks/amorail.rake
209
209
  - spec/client_spec.rb
@@ -1,12 +0,0 @@
1
- require 'amorail'
2
- require 'rails'
3
-
4
- module Amorail
5
- # Amorail Rails engine
6
- # Load Amorails rake tasks
7
- class Engine < Rails::Engine
8
- rake_tasks do
9
- load File.expand_path("../../tasks/amorail.rake", __FILE__)
10
- end
11
- end
12
- end