plant 0.6.0 → 0.6.1

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: 347097da4cb94c38e919978e527dd0093c8bd726
4
- data.tar.gz: 08af0ca4e063794b03d9b54dec568b112914c8e7
3
+ metadata.gz: b1942967aeeab9dd650cedace8e56a62da4af213
4
+ data.tar.gz: 631ab72e1d8a5cb473c106637dfd37b2566fef77
5
5
  SHA512:
6
- metadata.gz: c256b54ae7808907aed2e994f524456fb23b07c59bf9f28f181236663946eae5a149e6edeab48a1cd587319081685535f896626465ef30fce3150b02f6056ee4
7
- data.tar.gz: e88d69778788306ca9003b8d3cf14769c50428d3a7e6eb64378429dc1a0704b662a258f51a702c6be3a5afa6dcf185724b9e1de02f7c882d534483f285100fbe
6
+ metadata.gz: 2e52cc5327cd5d737bcf11d07325abc62d37b33ca817d617c8a227a1ddc478818fc5b0d4c50e9449e8746797cc823ad6dc927aaf0b027d8eb485de7dc6cc2618
7
+ data.tar.gz: a6634e55098fd04029326430c5f24f548c757257f3f58ff485a1f734b464886f5e160627b38cc39eabc16151217a013fed50b99bd0d83affef84a0347fbfa302
data/README.md ADDED
@@ -0,0 +1,87 @@
1
+ # Plant
2
+
3
+ ## Dont just seed, plant.
4
+
5
+ This gem allows you to define your content in yaml files, then to be
6
+ loaded into the database by a rake task. You then get source control on
7
+ your yml files, with the flexibility of being able to use a databse
8
+ searching engine to search for content.
9
+
10
+ ## Installation
11
+
12
+ Add to your gem file:
13
+
14
+ gem 'plant'
15
+
16
+ run `bundle install`
17
+
18
+ Then copy the migrations over and run them
19
+ `rake plant:install:migrations `
20
+ `rake db:migrate`
21
+
22
+ ## Usage
23
+
24
+ Add your content to app/content/any/path/blah.yml, plant will pick
25
+ up on any yml files in app/content.
26
+
27
+ With some content added run:
28
+ `rake plant:seed`
29
+
30
+ You can run this as many times as you like and the content will be
31
+ replaced with tah in your yaml file.
32
+
33
+ No to output it onto your page, simply use the helper:
34
+
35
+ = plant_content_for('any.path.blah.key', { scenario: current_user })
36
+
37
+ You can pass any argument as the scenario argument, plant will call
38
+ `.scenario` on it. So if you define a method in your user model called
39
+ scenario, this will be appended to the node search string:
40
+
41
+ ```
42
+ class User
43
+ def scenario
44
+ 'fish'
45
+ end
46
+ end
47
+ ```
48
+
49
+ => plant_content_for('red.buses', scenario: current_user)
50
+ will return the content for 'red.buses.fish' if it exists, if not will
51
+ return 'red.buses' or 'red.buses.main'
52
+
53
+ ### Interpolation
54
+
55
+ When defining content that needs a parameter, you can use standard ruby
56
+ interpolation i.e. #{name} but with SINGLE quotes, otherwise the
57
+ interpolation will be injected at yaml load time, which will be nil,
58
+ rather than at run time. If a content is defined as:
59
+ sample:
60
+ foo: 'Say hello to #{name}'
61
+ Calling plant_content_for('sample.foo', name: 'George') will return 'Say
62
+ hello to George'
63
+
64
+ ### HTML
65
+
66
+ If you want to include HTML in your content, you can. But when outputing
67
+ on to the page, you need to pass in html_safe.
68
+ => plant_content_for('sample.link', html_safe: true)
69
+
70
+ ### Capistrano
71
+
72
+ To work with capistrano include:
73
+ `require 'capistrano/plant'`
74
+ in your Capfile. This is not tested yet. Otherwise take a look at
75
+ lib/capistrano/tasks/plant.rake on how to run rake task on deploy
76
+
77
+ ## Development
78
+
79
+ To get started, clone the repo and run `bundle install`. This will get
80
+ all the stuff that you need. Then a simple `bundle exec guard` will
81
+ start the guard runner, which watches on rubocop and specs.
82
+ If you add functionality, please add tests.
83
+
84
+ Before pushing back to the repo, make sure that all tests pass.
85
+
86
+ ## Future features / Wish list
87
+ - Use git to find diffs so don't have to load all content every time
@@ -1 +1 @@
1
- load File.expand_path("../tasks/plant.rake", __FILE__)
1
+ load File.expand_path('../tasks/plant.rake', __FILE__)
data/lib/plant/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # Version file
2
2
  module Plant
3
- VERSION = '0.6.0'
3
+ VERSION = '0.6.1'
4
4
  end
@@ -9,6 +9,6 @@ namespace :plant do
9
9
  content_obj.save!
10
10
  count += 1
11
11
  end
12
- puts 'Planted #{count} seeds.'
12
+ puts "Planted #{count} seeds."
13
13
  end
14
14
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yule
@@ -171,6 +171,7 @@ executables: []
171
171
  extensions: []
172
172
  extra_rdoc_files: []
173
173
  files:
174
+ - README.md
174
175
  - Rakefile
175
176
  - app/helpers/plant/plant_helper.rb
176
177
  - app/models/plant/content.rb
@@ -183,7 +184,7 @@ files:
183
184
  - lib/plant/utils.rb
184
185
  - lib/plant/version.rb
185
186
  - lib/tasks/plant_tasks.rake
186
- homepage: http://www.dryule.com
187
+ homepage: https://rubygems.org/gems/plant
187
188
  licenses:
188
189
  - MIT
189
190
  metadata: {}