colonization 0.3 → 0.3.1

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: e9907296322411ab264d5463c48bd55edfc83d5a
4
- data.tar.gz: a7a487a862999ce8e6b35db4a32dec3b0fcf55ce
3
+ metadata.gz: 8568fe85422ca7740126206b7df754c16391c5cb
4
+ data.tar.gz: f89833d1ca93b44256b46bd3e4e0343dcdd354c0
5
5
  SHA512:
6
- metadata.gz: ad86fc64496fac7815bab8ff3953c3611d78e866dd6cbefdd212db619e56113d0597884ee7b1a9c99544b4a3d1dd25f423623a78aaf6421125f8c1d161e3b06b
7
- data.tar.gz: 78e4eaa67eaab63afaff5da1053b0984b937581c01f6ff7684bdaab3187b0d73c34b4bf258a69ce32196b461a774b447aa5797ca624c5de546cf947ae36dc11c
6
+ metadata.gz: 66e0cd1d5896ca41c8e4c300db442cb2c2ed45c8a259af87ed238c409230acd946e81940d38349ac008ffbe7db79e745b8f6d657539f3644a93cdb5e2418add2
7
+ data.tar.gz: 0805aa28b92176fc9ef77cc9a9d1579a7b72d7eddbca410aa5a3c3717ad88200c59c35a12c58fe87f5025916e50dfc81608c6ccf704339c8bcd481789afdbb38
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Colonization
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/colonization`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Gem for development database populating. Data seeding regarding to your models fields, their types and validations. It is in development now - only presence and acceptance validations currently supported.
6
4
 
7
5
  ## Installation
8
6
 
@@ -22,15 +20,52 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ Add then following to seeds.rb file:
24
+
25
+ ```ruby
26
+ Colonization::Ship.new.colonize
27
+ ```
28
+ That's all!
29
+
30
+ ## Customization
31
+
32
+ Add colonization.rb file to your initializers:
33
+
34
+ ```ruby
35
+ Colonization.configure do |config|
36
+ config.something = :something
37
+ config.seed_type = :default
38
+ config.seed_index = 4
39
+ config.count_of_instances_to_seed = 10
40
+ config.clear_table = true
41
+ end
42
+ ```
43
+
44
+ List of currently allowed configurations:
45
+
46
+ seed_type:
47
+
48
+ currently 2 seed strategies are supported - :fixed and :default. Fixed strategy seeding fixed count of
49
+ instances(user will be able to customize this for each model, it is in development now), by default it is 100. Default strategy populates database according to other configuration setting - :seed_index. By this strategy count of model instances will increase by geometric progression(from parent models to dependent), by default - 3.
50
+
51
+ seed_index:
52
+ by default: 3
53
+
54
+ index according to model instances count increase(from parent model to child). E.g. Client has_many orders. With seed_index = 3 Client will have 100 instances, Order - up to 300
55
+ It is used only by default seed strategy
56
+
57
+ count_of_instances_to_seed:
58
+ by_default: 100
59
+
60
+ Used by both strategies. For fixed strategy it means - accurate number of instances to create, for default strategy - instances count for top level model
26
61
 
27
- ## Development
62
+ clear_table:
63
+ by_default: true
28
64
 
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
65
+ Clear or not table before seeding
30
66
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec 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).
32
67
 
33
68
  ## Contributing
34
69
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/colonization.
70
+ Bug reports and pull requests are welcome on GitHub at https://github.com/dongan2010/colonization.
36
71
 
@@ -1,3 +1,3 @@
1
1
  module Colonization
2
- VERSION = "0.3"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: colonization
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denys Dvoriashyn