plant 1.0.0 → 1.1.0

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.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +21 -0
  3. data/app/helpers/plant/plant_helper.rb +3 -0
  4. data/app/models/plant/content.rb +1 -65
  5. data/lib/capistrano/tasks/plant.rake +1 -0
  6. data/lib/plant/core.rb +81 -0
  7. data/lib/plant/engine.rb +1 -0
  8. data/lib/plant/utils.rb +1 -0
  9. data/lib/plant/version.rb +1 -1
  10. data/lib/plant.rb +2 -0
  11. data/lib/tasks/plant_tasks.rake +3 -1
  12. data/spec/dummy/README.rdoc +28 -0
  13. data/spec/dummy/Rakefile +3 -0
  14. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  15. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  16. data/spec/dummy/app/content/jupiter/io.yml +8 -0
  17. data/spec/dummy/app/content/solar/earth/moon.yml +0 -0
  18. data/spec/dummy/app/content/sun.yml +0 -0
  19. data/spec/dummy/app/controllers/application_controller.rb +6 -0
  20. data/spec/dummy/app/helpers/application_helper.rb +3 -0
  21. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  22. data/spec/dummy/bin/bundle +3 -0
  23. data/spec/dummy/bin/rails +4 -0
  24. data/spec/dummy/bin/rake +4 -0
  25. data/spec/dummy/bin/setup +29 -0
  26. data/spec/dummy/config/application.rb +15 -0
  27. data/spec/dummy/config/boot.rb +5 -0
  28. data/spec/dummy/config/database.yml +25 -0
  29. data/spec/dummy/config/environment.rb +5 -0
  30. data/spec/dummy/config/environments/development.rb +32 -0
  31. data/spec/dummy/config/initializers/assets.rb +2 -0
  32. data/spec/dummy/config/initializers/session_store.rb +3 -0
  33. data/spec/dummy/config/initializers/wrap_parameters.rb +8 -0
  34. data/spec/dummy/config/locales/en.yml +23 -0
  35. data/spec/dummy/config/routes.rb +3 -0
  36. data/spec/dummy/config/secrets.yml +22 -0
  37. data/spec/dummy/config.ru +4 -0
  38. data/spec/dummy/db/development.sqlite3 +0 -0
  39. data/spec/dummy/db/schema.rb +9 -0
  40. data/spec/dummy/db/test.sqlite3 +0 -0
  41. data/spec/dummy/log/development.log +28 -0
  42. data/spec/dummy/log/test.log +9737 -0
  43. data/spec/dummy/public/404.html +67 -0
  44. data/spec/dummy/public/422.html +67 -0
  45. data/spec/dummy/public/500.html +66 -0
  46. data/spec/dummy/public/favicon.ico +0 -0
  47. data/spec/factories.rb +6 -0
  48. data/spec/helpers/plant/plant_helper_spec.rb +27 -0
  49. data/spec/lib/core_spec.rb +85 -0
  50. data/spec/lib/hash_pathify_spec.rb +42 -0
  51. data/spec/lib/seed_spec.rb +48 -0
  52. data/spec/lib/utils_spec.rb +20 -0
  53. data/spec/models/plant/content_spec.rb +9 -0
  54. data/spec/sample_spec.rb +5 -0
  55. data/spec/spec_helper.rb +58 -0
  56. data/spec/support/test.yml +4 -0
  57. metadata +97 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4cc34f83987f032647f5fd8685def8fd32dc718e
4
- data.tar.gz: e8ad1c5536f32347603df3a111d26a945c19a0d7
3
+ metadata.gz: fd41caf850e81cba20f441d090d7f6329ead3cc2
4
+ data.tar.gz: b15e9dc6409f83ff0b38159b962a689b2b537e8a
5
5
  SHA512:
6
- metadata.gz: 57ebd7b8f39fa729eecb8597621e3f7fe4f95a6f02706758007471b2d4661f94e4724ecd3db4757a92cbacd075a82878809c88008aa2fd4fafe4c59819b10283
7
- data.tar.gz: 76dd1321e3607ad8efb0df2453f66c9d6ff112e24398f994c5c8afe8e2c5b225f6b3925aaa1ce2e10819b3b58b972fbf3839e272b8d04a977f8c054834fa73b2
6
+ metadata.gz: d79c05fe73790426f4394b4f82fafa536d84f8e557664eb1eddf583a7827db536d0b0d7fc53eb725c2fb18d7a57d46281bfd25495fd8c7127cded6efd2f5f06b
7
+ data.tar.gz: 524510dcb7c795f2cc004f3ff63a686b16c186c48cb0e2450606c224d5a1e61ae51cb19af7f454dc9ef8785a0781fa52b1581a68fc40ae34dc730108a094c6ef
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ Author: Paul Brennan, AHC
2
+ Copyright (c) 2015, AHC
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -2,6 +2,9 @@
2
2
  module Plant
3
3
  # Namespace application helper for writing to page
4
4
  module PlantHelper
5
+ # Writes the content out onto the page for the given node.
6
+ # Params: options: Hash:
7
+ # => html_safe: whether to allow html or not.
5
8
  def plant_content_for(node, options = {})
6
9
  content = Plant::Content.get_node_content(node, options)
7
10
  if options[:html_safe]
@@ -1,70 +1,6 @@
1
1
  module Plant
2
2
  # Model for content
3
3
  class Content < ActiveRecord::Base
4
- # Can only have one scenario-node_id combination
5
- validates_uniqueness_of :node_id
6
-
7
- # Gets a given node
8
- # => Parameter: node ID (string)
9
- # => Parameter: Options (hash), containing
10
- # - scenario (optional)
11
- # Can either be a string or an object with
12
- # a scenario method, for example a user.
13
- #
14
- # If no specific scenario returned, then will
15
- # default back to a nil scenario.
16
- #
17
- # => Throws: NotFound if node not found
18
- # => Returns: A content object
19
- def self.get_node(node_id, options = {})
20
- options = defaults.merge(options)
21
- find_specific(node_id, options[:scenario]) || find_main(node_id)
22
- end
23
-
24
- def self.defaults
25
- { scenario: nil,
26
- parameters: {} }
27
- end
28
-
29
- # Convenience method to get the content of a given node
30
- # => Paramter: node ID (string)
31
- # => Paramter: Options (hash)
32
- # - scenario
33
- # Can either be a string or an object with
34
- # a scenario method, for example a user
35
- #
36
- # - Also can be any arbitary key to be injected into the
37
- # returned content. For example
38
- # When called get_node_content(node_id, foo: 'hhh)
39
- # "This is content for #{foo} and bar"
40
- # will return 'This is content for hhh and bar'
41
- #
42
- # Note: If second parameter is a string, it will be treated as
43
- # scenario.
44
- # Also see: get_node
45
- def self.get_node_content(node_id, options = {})
46
- options = { scenario: options } unless options.is_a? Hash
47
- options = defaults.merge(options)
48
- inject_content(get_node(node_id, options).content, options)
49
- end
50
-
51
- # Interpolation of content
52
- def self.inject_content(content, options)
53
- options.each do |key, replacement|
54
- content.gsub!("\#\{#{key}\}", replacement.to_s)
55
- end
56
- content
57
- end
58
-
59
- def self.find_specific(node, scenario)
60
- scenario = scenario.scenario if scenario.respond_to? :scenario
61
- find_by(node_id: "#{node}.#{scenario}")
62
- end
63
-
64
- def self.find_main(node)
65
- main = find_by(node_id: "#{node}.main")
66
- return main if main
67
- find_by!(node_id: "#{node}")
68
- end
4
+ include Plant::Core
69
5
  end
70
6
  end
@@ -1,3 +1,4 @@
1
+ # Deploy hook to load the seed each time the app is deployed.
1
2
  namespace :plant do
2
3
  desc 'Load seeds from yaml files with plant'
3
4
  task :seed do
data/lib/plant/core.rb ADDED
@@ -0,0 +1,81 @@
1
+ module Plant
2
+ # Main Plant Methods
3
+ module Core
4
+ extend ActiveSupport::Concern
5
+ included do
6
+ # Can only have one scenario-node_id combination
7
+ validates_uniqueness_of :node_id
8
+ end
9
+
10
+ # All methods are class level, extend this class to allow for instance
11
+ # level variables
12
+ module ClassMethods
13
+ # Gets a given node
14
+ # => Parameter: node ID (string)
15
+ # => Parameter: Options (hash), containing
16
+ # - scenario (optional)
17
+ # Can either be a string or an object with
18
+ # a scenario method, for example a user.
19
+ #
20
+ # If no specific scenario returned, then will
21
+ # default back to a nil scenario.
22
+ #
23
+ # => Throws: NotFound if node not found
24
+ # => Returns: A content object
25
+ def get_node(node_id, options = {})
26
+ options = defaults.merge(options)
27
+ find_specific(node_id, options[:scenario]) || find_main(node_id)
28
+ end
29
+
30
+ def defaults
31
+ { scenario: nil,
32
+ parameters: {} }
33
+ end
34
+
35
+ # Convenience method to get the content of a given node
36
+ # => Paramter: node ID (string)
37
+ # => Paramter: Options (hash)
38
+ # - scenario
39
+ # Can either be a string or an object with
40
+ # a scenario method, for example a user
41
+ #
42
+ # - Also can be any arbitary key to be injected into the
43
+ # returned content. For example
44
+ # When called get_node_content(node_id, foo: 'hhh)
45
+ # "This is content for #{foo} and bar"
46
+ # will return 'This is content for hhh and bar'
47
+ #
48
+ # Note: If second parameter is a string, it will be treated as
49
+ # scenario.
50
+ # Also see: get_node
51
+ def get_node_content(node_id, options = {})
52
+ options = { scenario: options } unless options.is_a? Hash
53
+ options = defaults.merge(options)
54
+ inject_content(get_node(node_id, options).content, options)
55
+ end
56
+
57
+ # Interpolation of content
58
+ def inject_content(content, options)
59
+ options.each do |key, replacement|
60
+ content.gsub!("\#\{#{key}\}", replacement.to_s)
61
+ end
62
+ content
63
+ end
64
+
65
+ # Private
66
+ # Finds a specific scenario
67
+ def find_specific(node, scenario)
68
+ scenario = scenario.scenario if scenario.respond_to? :scenario
69
+ find_by(node_id: "#{node}.#{scenario}")
70
+ end
71
+
72
+ # Private
73
+ # Find the main node or falls back to the node if main does not exist.
74
+ def find_main(node)
75
+ main = find_by(node_id: "#{node}.main")
76
+ return main if main
77
+ find_by!(node_id: "#{node}")
78
+ end
79
+ end
80
+ end
81
+ end
data/lib/plant/engine.rb CHANGED
@@ -9,6 +9,7 @@ module Plant
9
9
  g.assets false
10
10
  g.helper false
11
11
  end
12
+ # Auto-include the Plant Helper
12
13
  initializer 'plant.action_controller' do
13
14
  ActiveSupport.on_load :action_controller do
14
15
  helper Plant::PlantHelper
data/lib/plant/utils.rb CHANGED
@@ -17,6 +17,7 @@ module Plant
17
17
  {}
18
18
  end
19
19
 
20
+ # Loads all the yaml files into memory
20
21
  def self.load_all_yaml_files(dir = 'app/content')
21
22
  Plant::Utils.yaml_files(dir).inject({}) do |memo, fle|
22
23
  memo.merge(Plant::Utils.load_yaml_file(fle))
data/lib/plant/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # Version file
2
2
  module Plant
3
- VERSION = '1.0.0'
3
+ VERSION = '1.1.0'
4
4
  end
data/lib/plant.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require 'plant/hash_pathify'
2
2
  require 'plant/engine'
3
3
  require 'plant/utils'
4
+ require 'plant/core'
4
5
  # Main module
5
6
  module Plant
7
+ # Plant namespace
6
8
  end
@@ -9,9 +9,10 @@ namespace :plant do
9
9
  puts "Planted #{count} seeds."
10
10
  end
11
11
 
12
+ desc 'Puts the content from the YAML files in app/content into the database'
12
13
  task seeds: :seed
13
14
 
14
- desc 'puts the content from yaml_file.yml into the database. Usage: rake plant:specific_seed[yaml_file.yml]'
15
+ desc 'Usage: rake plant:specific_seed[yaml_file.yml] imports yaml_file'
15
16
  task :specific_seed, [:yaml_path] => :environment do |_, args|
16
17
  Plant::Utils.load_yaml_file(args[:yaml_path]).each do |full_node, value|
17
18
  add_object(full_node, value)
@@ -19,6 +20,7 @@ namespace :plant do
19
20
  end
20
21
  end
21
22
 
23
+ # Adds the object to the database from a yaml file
22
24
  def add_object(full_node, value)
23
25
  content_obj = Plant::Content.find_or_initialize_by(node_id: full_node)
24
26
  content_obj.content = value.chomp
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,3 @@
1
+ require File.expand_path('../config/application', __FILE__)
2
+
3
+ Rails.application.load_tasks
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,8 @@
1
+ jupiter:
2
+ io:
3
+ moon_name:
4
+ main: 'Foobar'
5
+ tuesdays: 'Barfoo'
6
+ wednesdays: >
7
+ multi line content
8
+ with some stuff
File without changes
File without changes
@@ -0,0 +1,6 @@
1
+ # Sample app controller
2
+ class ApplicationController < ActionController::Base
3
+ # Prevent CSRF attacks by raising an exception.
4
+ # For APIs, you may want to use :null_session instead.
5
+ protect_from_forgery with: :exception
6
+ end
@@ -0,0 +1,3 @@
1
+ # sample application helpr
2
+ module ApplicationHelper
3
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ # path to your application root.
5
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
+
7
+ Dir.chdir APP_ROOT do
8
+ # This script is a starting point to setup your application.
9
+ # Add necessary setup steps to this file:
10
+
11
+ puts '== Installing dependencies =='
12
+ system 'gem install bundler --conservative'
13
+ system 'bundle check || bundle install'
14
+
15
+ # puts '\n== Copying sample files =='
16
+ # unless File.exist?('config/database.yml')
17
+ # system 'cp config/database.yml.sample config/database.yml'
18
+ # end
19
+
20
+ puts '\n== Preparing database =='
21
+ system 'bin/rake db:setup'
22
+
23
+ puts '\n== Removing old logs and tempfiles =='
24
+ system 'rm -f log/*'
25
+ system 'rm -rf tmp/cache'
26
+
27
+ puts '\n== Restarting application server =='
28
+ system 'touch tmp/restart.txt'
29
+ end
@@ -0,0 +1,15 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require(*Rails.groups)
6
+ require 'plant'
7
+
8
+ module Dummy
9
+ # The sample app
10
+ class Application < Rails::Application
11
+ # Do not swallow errors in after_commit/after_rollback callbacks.
12
+ config.active_record.raise_in_transactional_callbacks = true
13
+ config.eager_load = false
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: db/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: db/production.sqlite3
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,32 @@
1
+ Rails.application.configure do
2
+ # since you don't have
3
+ config.cache_classes = false
4
+
5
+ # Do not eager load code on boot.
6
+ config.eager_load = false
7
+
8
+ # Show full error reports and disable caching.
9
+ config.consider_all_requests_local = true
10
+ config.action_controller.perform_caching = false
11
+
12
+ # Don't care if the mailer can't send.
13
+ config.action_mailer.raise_delivery_errors = false
14
+
15
+ # Print deprecation notices to the Rails logger.
16
+ config.active_support.deprecation = :log
17
+
18
+ # Raise an error on page load if there are pending migrations.
19
+ config.active_record.migration_error = :page_load
20
+
21
+ config.assets.debug = true
22
+
23
+ config.assets.digest = true
24
+
25
+ # Adds additional error checking when serving assets at runtime.
26
+ # Checks for improperly declared sprockets dependencies.
27
+ # Raises helpful error messages.
28
+ config.assets.raise_runtime_errors = true
29
+
30
+ # Raises error for missing translations
31
+ # config.action_view.raise_on_missing_translations = true
32
+ end
@@ -0,0 +1,2 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ Rails.application.config.assets.version = '1.0'
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ ActiveSupport.on_load(:action_controller) do
7
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
8
+ end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ mount Plant::Engine => '/plant'
3
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: 7c5be3ff2f86bf8619d9e8a085210cdb3369b195b4ebd2bd18dbf91cdf7d73b8fa13089c165d40b3f916653ee2b3c4e7809788183b49575cf6060f5dcf12a746
15
+
16
+ test:
17
+ secret_key_base: 09dcff95e386330ba66c03f108b694004258d2a03e416095a9a16f6e9792f0ffaadbf7c07b22468d9d08d6b63055b5ff47635282e31bc89aa55aa7bf4d9d86c4
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
Binary file
@@ -0,0 +1,9 @@
1
+ # encoding: UTF-8
2
+ ActiveRecord::Schema.define(version: '20150820134825') do
3
+ create_table 'plant_contents', force: :cascade do |t|
4
+ t.string 'node_id'
5
+ t.text 'content'
6
+ t.datetime 'created_at', null: false
7
+ t.datetime 'updated_at', null: false
8
+ end
9
+ end
Binary file
@@ -0,0 +1,28 @@
1
+ Plant::Content Load (0.2ms) SELECT "plant_contents".* FROM "plant_contents" WHERE "plant_contents"."node_id" = ? LIMIT 1 [["node_id", "jupiter.io.moon_name.main"]]
2
+  (0.2ms) begin transaction
3
+ Plant::Content Exists (0.1ms) SELECT 1 AS one FROM "plant_contents" WHERE ("plant_contents"."scenario" IS NULL AND "plant_contents"."node_id" = 'jupiter.io.moon_name.main') LIMIT 1
4
+ SQL (0.2ms) INSERT INTO "plant_contents" ("node_id", "content", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["node_id", "jupiter.io.moon_name.main"], ["content", "Foobar"], ["created_at", "2015-08-21 13:45:12.153929"], ["updated_at", "2015-08-21 13:45:12.153929"]]
5
+  (8.5ms) commit transaction
6
+ Plant::Content Load (0.1ms) SELECT "plant_contents".* FROM "plant_contents" WHERE "plant_contents"."node_id" = ? LIMIT 1 [["node_id", "jupiter.io.moon_name.tuesdays"]]
7
+  (0.1ms) begin transaction
8
+ Plant::Content Exists (0.1ms) SELECT 1 AS one FROM "plant_contents" WHERE ("plant_contents"."scenario" IS NULL AND "plant_contents"."node_id" = 'jupiter.io.moon_name.tuesdays') LIMIT 1
9
+ SQL (0.1ms) INSERT INTO "plant_contents" ("node_id", "content", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["node_id", "jupiter.io.moon_name.tuesdays"], ["content", "Barfoo"], ["created_at", "2015-08-21 13:45:12.166374"], ["updated_at", "2015-08-21 13:45:12.166374"]]
10
+  (3.4ms) commit transaction
11
+ Plant::Content Load (0.1ms) SELECT "plant_contents".* FROM "plant_contents" WHERE "plant_contents"."node_id" = ? LIMIT 1 [["node_id", "jupiter.io.moon_name.wednesdays"]]
12
+  (0.4ms) begin transaction
13
+ Plant::Content Exists (0.1ms) SELECT 1 AS one FROM "plant_contents" WHERE ("plant_contents"."scenario" IS NULL AND "plant_contents"."node_id" = 'jupiter.io.moon_name.wednesdays') LIMIT 1
14
+ SQL (0.1ms) INSERT INTO "plant_contents" ("node_id", "content", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["node_id", "jupiter.io.moon_name.wednesdays"], ["content", "multi line content with some stuff\n"], ["created_at", "2015-08-21 13:45:12.172588"], ["updated_at", "2015-08-21 13:45:12.172588"]]
15
+  (3.4ms) commit transaction
16
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
17
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
18
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
19
+  (12.6ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
20
+  (0.1ms) select sqlite_version(*)
21
+  (3.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
22
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
23
+ Migrating to CreatePlantContents (20150820134825)
24
+  (0.1ms) begin transaction
25
+  (0.2ms) CREATE TABLE "plant_contents" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "node_id" varchar, "content" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
26
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150820134825"]]
27
+  (4.4ms) commit transaction
28
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"