Permalink
Browse files

small tweaks before we push a gem

  • Loading branch information...
1 parent 36f02f6 commit cb9323de358359fe44add65866ef00001b40f752 @julesce julesce committed Mar 19, 2012
View
153 .gitignore
@@ -0,0 +1,153 @@
+.bundle
+db/*.sqlite3
+log/*.log
+tmp/
+# Rails
+.bundle
+db/*.sqlite3
+db/*.sqlite3-journal
+*.log
+tmp/**/*
+.suo
+
+# Documentation
+doc/api
+doc/app
+doc/*
+.yardoc
+.yardopts
+
+# Public Uploads
+public/system/*
+public/themes/*
+
+# Public Cache
+public/javascripts/cache
+public/stylesheets/cache
+
+# Vendor Cache
+vendor/cache
+
+# Acts as Indexed
+index/**/*
+
+# Refinery Specific
+*.tmproj
+*.autobackupbyrefinery.*
+/refinerycms-*.gem
+.autotest
+
+# Mac
+.DS_Store
+
+# Windows
+Thumbs.db
+
+# NetBeans
+nbproject
+
+# Eclipse
+.project
+
+# Redcar
+.redcar
+
+# Rubinius
+*.rbc
+
+# Vim
+*.swp
+*.swo
+
+# RubyMine
+.idea
+
+# Backup
+*~
+
+# Capybara Bug
+capybara-*html
+
+# sass
+.sass-cache
+.sass-cache/*
+
+#rvm
+.rvmrc
+.rvmrc.*
+
+# Rails
+.bundle
+db/*.sqlite3
+db/*.sqlite3-journal
+*.log
+tmp
+tmp/**/*
+
+# Documentation
+doc/api
+doc/app
+.yardoc
+.yardopts
+
+# Public Uploads
+public/system/*
+public/themes/*
+
+# Public Cache
+public/javascripts/cache
+public/stylesheets/cache
+
+# Vendor Cache
+vendor/cache
+
+# Acts as Indexed
+index/**/*
+
+# Refinery Specific
+*.tmproj
+*.autobackupbyrefinery.*
+refinerycms-*.gem
+.autotest
+
+# Mac
+.DS_Store
+
+# Windows
+Thumbs.db
+
+# NetBeans
+nbproject
+
+# Eclipse
+.project
+
+# Redcar
+.redcar
+
+# Rubinius
+*.rbc
+
+# Vim
+*.swp
+*.swo
+
+# RubyMine
+.idea
+
+# E-texteditor
+.eprj
+
+# Backup
+*~
+
+# Capybara Bug
+capybara-*html
+
+# sass
+.sass-cache
+.sass-cache/*
+
+#rvm
+.rvmrc
+.rvmrc.*
View
30 app/controllers/variants_controller.rb
@@ -1,30 +0,0 @@
-class VariantsController < ApplicationController
-
- before_filter :find_all_variants
- before_filter :find_page
-
- def index
- # you can use meta fields from your model instead (e.g. browser_title)
- # by swapping @page for @variant in the line below:
- present(@page)
- end
-
- def show
- @variant = Variant.find(params[:id])
-
- # you can use meta fields from your model instead (e.g. browser_title)
- # by swapping @page for @variant in the line below:
- present(@page)
- end
-
-protected
-
- def find_all_variants
- @variants = Variant.order('position ASC')
- end
-
- def find_page
- @page = Page.where(:link_url => "/variants").first
- end
-
-end
View
2 app/models/variant.rb
@@ -10,7 +10,7 @@ class Variant < ActiveRecord::Base
delegate :url, :to => :image, :prefix => true
- def name_and_price
+ def name_and_price
name + " - R" + price.to_i.to_s
end
end
View
11 app/views/variants/index.html.erb
@@ -1,11 +0,0 @@
-<% content_for :body_content_left do %>
- <ul id="variants">
- <% @variants.each do |variant| %>
- <li>
- <%= link_to variant.name, variant_path(variant) %>
- </li>
- <% end %>
- </ul>
-<% end %>
-
-<%= render :partial => "/shared/content_page" %>
View
45 app/views/variants/show.html.erb
@@ -1,45 +0,0 @@
-<% content_for :body_content_title do %>
- <%= @variant.name %>
-<% end %>
-
-<% content_for :body_content_left do %>
- <section>
- <h1>Name</h1>
- <p>
- <%=raw @variant.name %>
- </p>
- </section>
- <section>
- <h1>Image</h1>
- <p>
- <%= image_fu @variant.image, nil %>
- </p>
- </section>
- <section>
- <h1>Price</h1>
- <p>
- <%=raw @variant.price %>
- </p>
- </section>
- <section>
- <h1>Stock Code</h1>
- <p>
- <%=raw @variant.stock_code %>
- </p>
- </section>
-<% end %>
-
-<% content_for :body_content_right do %>
- <aside>
- <h2><%= t('.other') %></h2>
- <ul id="variants">
- <% @variants.each do |variant| %>
- <li>
- <%= link_to variant.name, variant_path(variant) %>
- </li>
- <% end %>
- </ul>
- </aside>
-<% end %>
-
-<%= render :partial => "/shared/content_page" %>
View
2 config/routes.rb
@@ -1,5 +1,5 @@
::Refinery::Application.routes.draw do
- resources :variants, :only => [:index, :show]
+ # resources :variants, :only => [:index, :show]
scope(:path => 'refinery', :as => 'admin', :module => 'admin') do
resources :variants, :except => :show do
View
6 db/migrate/create_variants.rb
@@ -21,9 +21,9 @@ def self.down
UserPlugin.destroy_all({:name => "variants"})
end
- if defined?(Page)
- Page.delete_all({:link_url => "/variants"})
- end
+ #if defined?(Page)
+ # Page.delete_all({:link_url => "/variants"})
+ #end
drop_table :variants
end
View
37 readme.md
@@ -1,10 +1,31 @@
-# Variants engine for Refinery CMS.
+# Refinery CMS Product Variants
-## How to build this engine as a gem
+Product variants for your [Refinery CMS](http://refinerycms.com) website, that is making use of the following gem:
- cd vendor/engines/variants
- gem build refinerycms-variants.gemspec
- gem install refinerycms-variants.gem
-
- # Sign up for a http://rubygems.org/ account and publish the gem
- gem push refinerycms-variants.gem
++ Products - https://github.com/julesce/refinerycms-products (1.0)
+
+This version of `refinerycms-variants` supports Rails 3.0.x.
+
+## Requirements
+
+Refinery CMS version 1.0.x.
+
+## Install
+
+Make sure that the [products](https://github.com/julesce/refinerycms-products) gem has been installed.
+
+Open up your ``Gemfile`` and add the following:
+
+ gem 'refinerycms-variants', '~> 1.0.0'
+
+Now, run:
+
+ bundle install
+
+Next, run:
+
+ rails generate refinerycms_variants
+
+Migrate your database:
+
+ rake db:migrate
View
3 refinerycms-variants.gemspec
@@ -7,4 +7,7 @@ Gem::Specification.new do |s|
s.summary = 'Variants engine for Refinery CMS'
s.require_paths = %w(lib)
s.files = Dir['lib/**/*', 'config/**/*', 'app/**/*']
+ s.authors = ['James Thompson', 'Byron Peters']
+ s.email = 'james.b.thompson@gmail.com'
+ s.homepage = 'https://github.com/byropig/refinerycms-variants'
end

0 comments on commit cb9323d

Please sign in to comment.