seedify 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/seedify.rb +3 -1
- data/lib/seedify/base.rb +1 -1
- data/lib/seedify/param_value.rb +1 -1
- data/lib/seedify/storage.rb +2 -2
- data/lib/seedify/version.rb +1 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e30b412c681fb0bbe203e5f727f6e8fe07244899
|
4
|
+
data.tar.gz: 9e3756126a3fc222f419ef3c9fbb63388701ad80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 240aa1ee3cf2dd37aaa612f63f4f1502d4e8502753e0ac3dc8d00754aa59601357e9ca690a97a66479bfc1372bb4ef6747dc1ad43a7b2024c9c9e761e7cf6ced
|
7
|
+
data.tar.gz: 3cb870b74192c11a3c0c8277ebe5524435280810de7efadd1ffe0b29b4ccf67fe0a5ef69098e85ca8985c4292d2816848b114d9879c8873a4024c1ff83351aa2
|
data/README.md
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
[![Downloads](https://img.shields.io/gem/dt/seedify.svg?style=flat-square)](https://rubygems.org/gems/seedify)
|
5
5
|
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/visualitypl/seedify.svg?style=flat-square)](https://scrutinizer-ci.com/g/visualitypl/seedify/?branch=master)
|
6
6
|
[![Code Climate](https://img.shields.io/codeclimate/github/visualitypl/seedify.svg?style=flat-square)](https://codeclimate.com/github/visualitypl/seedify)
|
7
|
+
[![Test Coverage](https://img.shields.io/codeclimate/coverage/github/visualitypl/seedify.svg?style=flat-square)](https://codeclimate.com/github/visualitypl/seedify)
|
7
8
|
|
8
9
|
Let your seed code become a first-class member of the Rails app and put it into seed objects. **seedify** allows to implement and organize seeds in object-oriented fashion, putting them into `app/seeds` alongside the controllers, models etc. It also provides handy syntax for command line parameters and progress logging.
|
9
10
|
|
data/lib/seedify.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
require '
|
1
|
+
require 'active_support'
|
2
|
+
|
2
3
|
require 'seedify/param_reader'
|
3
4
|
require 'seedify/base'
|
4
5
|
require 'seedify/logger'
|
5
6
|
require 'seedify/storage'
|
6
7
|
require 'seedify/param_value'
|
7
8
|
require 'seedify/call_stack'
|
9
|
+
require 'seedify/railtie' if defined?(Rails)
|
data/lib/seedify/base.rb
CHANGED
@@ -14,7 +14,7 @@ module Seedify
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def self.params(overrides)
|
17
|
-
stacked_params = (Seedify::CallStack.last.
|
17
|
+
stacked_params = ((last = Seedify::CallStack.last) ? last.params : {}).merge(overrides)
|
18
18
|
defined_params = get_param_readers.map do |param_name, options|
|
19
19
|
[param_name, Seedify::ParamValue.get(param_name, options)]
|
20
20
|
end.to_h
|
data/lib/seedify/param_value.rb
CHANGED
data/lib/seedify/storage.rb
CHANGED
@@ -6,8 +6,8 @@ module Seedify
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def seed_list
|
9
|
-
@all_seeds ||= Dir[
|
10
|
-
file.sub(/^#{seed_directory.to_s + "/"}/, '').sub(/#{".rb"}$/, '')
|
9
|
+
@all_seeds ||= Dir[File.join(seed_directory, '**', '*_seed.rb')].map do |file|
|
10
|
+
ActiveSupport::Inflector.classify(file.sub(/^#{seed_directory.to_s + "/"}/, '').sub(/#{".rb"}$/, ''))
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
data/lib/seedify/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seedify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karol Słuszniak
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0.9'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: activesupport
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '3.0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '3.0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rails
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|