feather_cms 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -12,7 +12,11 @@ Now, generate the pages
12
12
 
13
13
  $ rake db:migrate
14
14
 
15
+ # Use file system to store pages( default: public/system/templates)
15
16
  $ rails g feather_cms about_us jobs team
17
+
18
+ #Use db to store pages
19
+ $ rails g feather_cms about_us jobs team --storage=db
16
20
 
17
21
  This generates a route, the controller action and the view for each page. Start the server and use the URL http://localhost:3000/feathers/pages to go to the admin panel.
18
22
 
@@ -1,3 +1,3 @@
1
1
  module FeatherCms
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -3,7 +3,7 @@ Description:
3
3
 
4
4
 
5
5
  Example:
6
- rails generate feather_cms about_us jobs [storage=file or db]
6
+ rails generate feather_cms about_us jobs [--storage=file or db]
7
7
 
8
8
  This will create:
9
9
  - Add config file 'feather_cms.eb'
@@ -2,16 +2,16 @@ class FeatherCmsGenerator < Rails::Generators::NamedBase
2
2
  source_root File.expand_path('../templates', __FILE__)
3
3
  argument :attributes, :type => :array, :banner => "about_us jobs"
4
4
  argument :name, :type => :string, :default => "feather_cms", :required => false
5
- argument :storage, :type => :string , :default => 'file'
5
+ class_option :storage, :aliases => '-s', :type => :string, :desc => 'db or file storage.'
6
6
 
7
7
  def create_cms_files
8
8
  @pages = attributes.collect(&:name)
9
9
 
10
- unless ['file', 'db'].include?(storage)
11
- puts "Valid storaage type are db,file"
12
- storaage = 'file'
13
- end
14
- @storaage = storaage
10
+ @storage = if ['file', 'db'].include?(options['storage'])
11
+ options['storage']
12
+ else
13
+ 'file'
14
+ end
15
15
 
16
16
  template 'initializer.rb', 'config/initializers/feather_cms.rb'
17
17
  template 'controller.rb', 'app/controllers/feathers_controller.rb'
@@ -9,7 +9,7 @@
9
9
  <%%= link_to 'Draft Page', feather_page_path('<%= @type %>', :draft) %>
10
10
  </li>
11
11
  <li>
12
- <%%= link_to 'Preview', feather_page_preview_path('<%= @type %>', status), target: '_blank' %>
12
+ <%%= link_to 'Preview', feather_page_preview_path('<%= @type %>', status), target: '_blank' unless @feather_page.new_record? %>
13
13
  </li>
14
14
  </ul>
15
15
  </div>
@@ -3,8 +3,8 @@ class CreateFeatherPages < ActiveRecord::Migration
3
3
  create_table :feather_pages do |t|
4
4
  t.string :name
5
5
  t.string :status, :default => 'draft'
6
- <% if @storaage == 'db' %>
7
- t.text :content
6
+ <% if @storage == 'db' %>
7
+ t.text :content
8
8
  <% end %>
9
9
  t.string :layout, :default => 'application'
10
10
  t.timestamps
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feather_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-30 00:00:00.000000000Z
12
+ date: 2012-04-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &9554190 !ruby/object:Gem::Requirement
16
+ requirement: &2156032340 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *9554190
24
+ version_requirements: *2156032340
25
25
  description: Lightweight do it youself cms
26
26
  email:
27
27
  - jiren@joshsoftware.com
@@ -95,4 +95,3 @@ signing_key:
95
95
  specification_version: 3
96
96
  summary: Lightweight do it youself cms
97
97
  test_files: []
98
- has_rdoc: