itsf_services 0.0.1 → 0.0.2

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: a107130b7ab2bb78b7d67cc18e8be8bcf8398bab
4
- data.tar.gz: cb7585bc4d51edf185959e0ad24db3cc2e81b4a1
3
+ metadata.gz: 4d0d8490c215e149350517465ece1376541b5e3d
4
+ data.tar.gz: 03b483c2a0bc91a7864f507a4f6e522e715e10a3
5
5
  SHA512:
6
- metadata.gz: 244bc213550b0db6f7ef9e026e34206409b221fdef68c6153ce27d1cdc98d514bd89a8ec506d6ea7f40e7de233474e88c28575401d71807437990199146d5dc0
7
- data.tar.gz: 745ed006d51aec988758b2982fb4ee2752f0d06203d7d95081c8b3a383a64828491f35636194b702aa7e4ee5718f4ff5edfd129f2a91980336bfe72a19c96306
6
+ metadata.gz: 8cfb138860536f00b461749930b6b01c289373502313d6ae50378c8be8a73c492b864a52071343960ec0c48895dcd62e5ee01c06b1e2c3c99bbfbd8ec4038463
7
+ data.tar.gz: b103ca61ba97fe19abe09e258322972f75a4f0b5e64fd05393917260fe507e212f497c8f20f9a87e6d35c9c9bcd4919c2a96c604a49de2ec3e6c70767f7c1887
data/Rakefile CHANGED
@@ -14,9 +14,4 @@ RDoc::Task.new(:rdoc) do |rdoc|
14
14
  rdoc.rdoc_files.include('lib/**/*.rb')
15
15
  end
16
16
 
17
-
18
17
  Bundler::GemHelper.install_tasks
19
-
20
-
21
-
22
- task default: :test
data/config/routes.rb CHANGED
@@ -1,2 +1,2 @@
1
1
  Itsf::Services::Engine.routes.draw do
2
- end
2
+ end
@@ -4,4 +4,4 @@ module Itsf
4
4
  isolate_namespace Itsf::Services
5
5
  end
6
6
  end
7
- end
7
+ end
@@ -9,19 +9,22 @@ module Itsf
9
9
  attr_writer :success
10
10
 
11
11
  def initialize
12
- @errors = ActiveModel::Errors.new(self)
13
- # @success = false
12
+ @errors = ActiveModel::Errors.new(self)
14
13
  end
15
14
 
16
15
  def success?
17
16
  @errors.blank?
18
17
  end
19
18
 
19
+ def failed?
20
+ !success?
21
+ end
22
+
20
23
  def read_attribute_for_validation(attr)
21
24
  send(attr)
22
25
  end
23
26
 
24
- def self.human_attribute_name(attr, options = {})
27
+ def self.human_attribute_name(attr, _options = {})
25
28
  attr
26
29
  end
27
30
 
@@ -31,11 +34,9 @@ module Itsf
31
34
 
32
35
  private
33
36
 
34
- def errors=(errors)
35
- @errors = errors
36
- end
37
+ attr_writer :errors
37
38
  end
38
39
  end
39
40
  end
40
41
  end
41
- end
42
+ end
@@ -11,7 +11,7 @@ module Itsf
11
11
  def_delegator :@instrumenter, :instrument
12
12
  attr_accessor :instrumenter
13
13
  attr_reader :response
14
-
14
+
15
15
  def self.i18n_scope
16
16
  'activerecord'
17
17
  end
@@ -22,21 +22,21 @@ module Itsf
22
22
 
23
23
  def initialize(attributes = {}, *args)
24
24
  options = args.extract_options!
25
- options.reverse_merge!({ :instrumenter => ActiveSupport::Notifications })
25
+ options.reverse_merge!(instrumenter: ActiveSupport::Notifications)
26
26
 
27
- @errors = ActiveModel::Errors.new(self)
27
+ @errors = ActiveModel::Errors.new(self)
28
28
 
29
29
  initialize_instrumenter(options[:instrumenter])
30
30
  instrument('initialize.export_to_sap.payment.dzb') do
31
31
  initialize_attributes if respond_to?(:initialize_attributes)
32
- set_attributes(attributes)
32
+ send_attributes(attributes)
33
33
  initialize_response
34
34
  end
35
35
  end
36
36
 
37
37
  private
38
38
 
39
- def set_attributes(attributes)
39
+ def send_attributes(attributes)
40
40
  attributes.each do |name, value|
41
41
  send("#{name}=", value)
42
42
  end
@@ -70,4 +70,4 @@ module Itsf
70
70
  end
71
71
  end
72
72
  end
73
- end
73
+ end
@@ -1,5 +1,5 @@
1
1
  module Itsf
2
2
  module Services
3
- VERSION = "0.0.1"
3
+ VERSION = '0.0.2'
4
4
  end
5
5
  end
data/lib/itsf_services.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'itsf/services/v2/service/base'
2
2
  require 'itsf/services/v2/response/base'
3
3
 
4
- require "itsf/services"
5
- require "itsf/services/engine"
4
+ require 'itsf/services'
5
+ require 'itsf/services/engine'
metadata CHANGED
@@ -1,32 +1,46 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itsf_services
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-25 00:00:00.000000000 Z
11
+ date: 2015-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  description: Provides Service Objects with rich Responses.
28
42
  email:
29
- - roberto.vasquez@anwr-group.com
43
+ - roberto@vasquez-angel.de
30
44
  executables: []
31
45
  extensions: []
32
46
  extra_rdoc_files: []
@@ -47,9 +61,6 @@ files:
47
61
  - lib/itsf/services/version.rb
48
62
  - lib/itsf_services.rb
49
63
  - lib/tasks/itsf/services_tasks.rake
50
- - test/integration/navigation_test.rb
51
- - test/itsf/services_test.rb
52
- - test/test_helper.rb
53
64
  homepage: https://github.com/robotex82/itsf_services
54
65
  licenses:
55
66
  - MIT
@@ -74,7 +85,5 @@ rubygems_version: 2.4.8
74
85
  signing_key:
75
86
  specification_version: 4
76
87
  summary: ITSF Services Rails Engine.
77
- test_files:
78
- - test/integration/navigation_test.rb
79
- - test/itsf/services_test.rb
80
- - test/test_helper.rb
88
+ test_files: []
89
+ has_rdoc:
@@ -1,10 +0,0 @@
1
- require 'test_helper'
2
-
3
- class NavigationTest < ActionDispatch::IntegrationTest
4
- fixtures :all
5
-
6
- # test "the truth" do
7
- # assert true
8
- # end
9
- end
10
-
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class Itsf::Services::Test < ActiveSupport::TestCase
4
- test "truth" do
5
- assert_kind_of Module, Itsf::Services
6
- end
7
- end
data/test/test_helper.rb DELETED
@@ -1,20 +0,0 @@
1
- # Configure Rails Environment
2
- ENV["RAILS_ENV"] = "test"
3
-
4
- require File.expand_path("../..//config/environment.rb", __FILE__)
5
- ActiveRecord::Migrator.migrations_paths = [File.expand_path("../..//db/migrate", __FILE__)]
6
- require "rails/test_help"
7
-
8
- # Filter out Minitest backtrace while allowing backtrace from other libraries
9
- # to be shown.
10
- Minitest.backtrace_filter = Minitest::BacktraceFilter.new
11
-
12
- # Load support files
13
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
14
-
15
- # Load fixtures from the engine
16
- if ActiveSupport::TestCase.respond_to?(:fixture_path=)
17
- ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
18
- ActiveSupport::TestCase.file_fixture_path = ActiveSupport::TestCase.fixture_path + "files"
19
- ActiveSupport::TestCase.fixtures :all
20
- end