performify 0.3.0 → 0.4.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: 7085550353873788be4efd8f4392e452552241ef
4
- data.tar.gz: 393c77cba7e60a2e5bf26f083782b1896a6df9f8
3
+ metadata.gz: a96ab69ab79f8f0b99f818b762c932b86d31ecc6
4
+ data.tar.gz: 58b169f4eccdffbb8caf2fddee1c5b89bb4369d4
5
5
  SHA512:
6
- metadata.gz: e9e118380656264e77d7785383e53c32fed6114cd184111e2d82a95cf3090e74ccb3ccd5eead974efcfc281e6e5fa7d0806812d379229248f0dd68643db65d49
7
- data.tar.gz: 5526665b6e8ac153390a79d07e88566e4392a30e5d32fa77afe39608edf6f11a41ccfe859b5da2deea6ad3c36914f797a233c98d0d8db11273e905f60db0baa4
6
+ metadata.gz: 1a1e944109d8ad0205d7080234a9073031f98af811c6b90aa018564661fd435c75952393c580e10a1881996eef203bbec337e38105199f4e3f1934162a3b2c3a
7
+ data.tar.gz: 82897b5b49b010f89481da7c23dda87f200b22f2e0ad7d63719aeb87ba99584cc10f92f5b697c51595eac21a074a5f4d050e793cab584ba6b065f45a6778b00a
data/README.md CHANGED
@@ -243,7 +243,7 @@ end
243
243
 
244
244
  ## Development
245
245
 
246
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
246
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/rspec spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
247
247
 
248
248
  To install this gem onto your local machine, run `bin/rake install`. To release a new version, update the version number in `version.rb`, and then run `bin/rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
249
249
 
@@ -18,9 +18,8 @@ module Performify
18
18
 
19
19
  return if args.empty?
20
20
 
21
- validate(args).each do |arg_name, arg_value|
22
- define_singleton_method(arg_name) { arg_value }
23
- end
21
+ validate(args)
22
+ define_singleton_methods(args)
24
23
 
25
24
  fail!(with_callbacks: true) if errors?
26
25
  end
@@ -75,5 +74,12 @@ module Performify
75
74
  def fail?
76
75
  @result.blank?
77
76
  end
77
+
78
+ private def define_singleton_methods(args)
79
+ param_names = schema ? schema.rules.keys : args.keys
80
+ param_names.each do |param_name|
81
+ define_singleton_method(param_name) { args[param_name] }
82
+ end
83
+ end
78
84
  end
79
85
  end
@@ -1,3 +1,3 @@
1
1
  module Performify
2
- VERSION = '0.3.0'.freeze
2
+ VERSION = '0.4.0'.freeze
3
3
  end
data/performify.gemspec CHANGED
@@ -1,5 +1,3 @@
1
- # coding: utf-8
2
-
3
1
  lib = File.expand_path('../lib', __FILE__)
4
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
3
  require 'performify/version'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: performify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Tsvetkov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-31 00:00:00.000000000 Z
11
+ date: 2017-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  version: '0'
170
170
  requirements: []
171
171
  rubyforge_project:
172
- rubygems_version: 2.5.1
172
+ rubygems_version: 2.6.11
173
173
  signing_key:
174
174
  specification_version: 4
175
175
  summary: Service classes that makes your life easier