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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d767dab70ab52f596d2604b3e3b1a9ff2ed1d831
4
- data.tar.gz: 17aa9c9bded036c02a9431f6196163d150137efc
3
+ metadata.gz: 347097da4cb94c38e919978e527dd0093c8bd726
4
+ data.tar.gz: 08af0ca4e063794b03d9b54dec568b112914c8e7
5
5
  SHA512:
6
- metadata.gz: 1471762fe46fa15424003009d6845145b87a8a76321a3c21003a0e9dcf12508cb2fec685b4808aaeafb3cfa5682060d4409038b5fe1053639c25594b347491f0
7
- data.tar.gz: c3da7fe7ba433d531ccc5b8deeeb402c29343c2a3028295d71ae22480355f92e5ec96b487115c220c6b05f3c4117c47267ac8df04de34422e87663257414836a
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, user = nil)
6
- Plant::Content.get_node_content(node, user)
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
@@ -1,4 +1,4 @@
1
1
  # Version file
2
2
  module Plant
3
- VERSION = '0.5.0'
3
+ VERSION = '0.6.0'
4
4
  end
@@ -1,11 +1,14 @@
1
1
  namespace :plant do
2
2
  desc 'Puts the content from the YAML files into the database'
3
- task populate: :environment do
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.5.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