plant 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/plant/plant_helper.rb +7 -2
- data/lib/capistrano/plant.rb +1 -0
- data/lib/capistrano/tasks/plant.rake +16 -0
- data/lib/plant/version.rb +1 -1
- data/lib/tasks/plant_tasks.rake +4 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 347097da4cb94c38e919978e527dd0093c8bd726
|
4
|
+
data.tar.gz: 08af0ca4e063794b03d9b54dec568b112914c8e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c256b54ae7808907aed2e994f524456fb23b07c59bf9f28f181236663946eae5a149e6edeab48a1cd587319081685535f896626465ef30fce3150b02f6056ee4
|
7
|
+
data.tar.gz: e88d69778788306ca9003b8d3cf14769c50428d3a7e6eb64378429dc1a0704b662a258f51a702c6be3a5afa6dcf185724b9e1de02f7c882d534483f285100fbe
|
@@ -2,8 +2,13 @@
|
|
2
2
|
module Plant
|
3
3
|
# Namespace application helper for writing to page
|
4
4
|
module PlantHelper
|
5
|
-
def plant_content_for(node,
|
6
|
-
Plant::Content.get_node_content(node,
|
5
|
+
def plant_content_for(node, options = {})
|
6
|
+
content = Plant::Content.get_node_content(node, options)
|
7
|
+
if options[:html_safe]
|
8
|
+
content.html_safe
|
9
|
+
else
|
10
|
+
ERB::Util.html_escape(content)
|
11
|
+
end
|
7
12
|
end
|
8
13
|
end
|
9
14
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path("../tasks/plant.rake", __FILE__)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
namespace :plant do
|
2
|
+
desc 'Load seeds from yaml files with plant'
|
3
|
+
task :seed do
|
4
|
+
on roles(:all) do
|
5
|
+
within release_path do
|
6
|
+
with rails_env: fetch(:rails_env) do
|
7
|
+
execute :rake, 'plant:seed'
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
namespace :deploy do
|
15
|
+
after :migrate, 'plant:seed'
|
16
|
+
end
|
data/lib/plant/version.rb
CHANGED
data/lib/tasks/plant_tasks.rake
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
namespace :plant do
|
2
2
|
desc 'Puts the content from the YAML files into the database'
|
3
|
-
task
|
3
|
+
task seed: :environment do
|
4
4
|
puts 'Planting those seeds'
|
5
|
+
count = 0
|
5
6
|
Plant::Utils.load_all_yaml_files.each do |full_node, value|
|
6
7
|
content_obj = Plant::Content.find_or_initialize_by(node_id: full_node)
|
7
8
|
content_obj.content = value.chomp
|
8
9
|
content_obj.save!
|
10
|
+
count += 1
|
9
11
|
end
|
12
|
+
puts 'Planted #{count} seeds.'
|
10
13
|
end
|
11
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.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yule
|
@@ -175,6 +175,8 @@ files:
|
|
175
175
|
- app/helpers/plant/plant_helper.rb
|
176
176
|
- app/models/plant/content.rb
|
177
177
|
- db/migrate/20150820134825_create_plant_contents.rb
|
178
|
+
- lib/capistrano/plant.rb
|
179
|
+
- lib/capistrano/tasks/plant.rake
|
178
180
|
- lib/plant.rb
|
179
181
|
- lib/plant/engine.rb
|
180
182
|
- lib/plant/hash_pathify.rb
|