shopqi-app 0.1.1 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ end
14
14
 
15
15
  RDoc::Task.new(:rdoc) do |rdoc|
16
16
  rdoc.rdoc_dir = 'rdoc'
17
- rdoc.title = 'ShopqiApp'
17
+ rdoc.title = 'ShopQiApp'
18
18
  rdoc.options << '--line-numbers'
19
19
  rdoc.rdoc_files.include('README.rdoc')
20
20
  rdoc.rdoc_files.include('lib/**/*.rb')
@@ -1,4 +1,4 @@
1
- module ShopqiApp
1
+ module ShopQiApp
2
2
  class ApplicationController < ActionController::Base
3
3
  include ApplicationHelper
4
4
  protect_from_forgery
@@ -1,5 +1,6 @@
1
- module ShopqiApp
1
+ module ShopQiApp
2
2
  class SessionsController < ApplicationController
3
+ skip_before_filter :authenticate_shop!, only: [:new, :create, :shopqi_login]
3
4
 
4
5
  def new
5
6
  if params[:shop].present?
@@ -1,7 +1,7 @@
1
- module ShopqiApp
1
+ module ShopQiApp
2
2
  module ApplicationHelper
3
3
  def authenticate_shop! # 必须通过认证
4
- redirect_to root_path unless signed_in?
4
+ redirect_to main_app.root_path unless signed_in?
5
5
  end
6
6
 
7
7
  def signed_in?
data/config/routes.rb CHANGED
@@ -1,4 +1,4 @@
1
- ShopqiApp::Engine.routes.draw do
1
+ ShopQiApp::Engine.routes.draw do
2
2
  match 'login' => 'sessions#new'
3
3
  get 'callback_login' => 'sessions#shopqi_login' # 从 ShopQi 后台管理点击应用直接登录
4
4
  get 'callback' => 'sessions#create'
@@ -1,4 +1,5 @@
1
- class ShopqiAppGenerator < Rails::Generators::Base
1
+ class ShopQiAppGenerator < Rails::Generators::Base
2
+ namespace 'shopqi_app'
2
3
  source_root File.expand_path('../templates', __FILE__)
3
4
 
4
5
  argument :client_id , type: :string, required: true
@@ -17,7 +18,7 @@ class ShopqiAppGenerator < Rails::Generators::Base
17
18
  end
18
19
 
19
20
  def add_routes
20
- route "mount ShopqiApp::Engine => '/app'"
21
+ route "mount ShopQiApp::Engine => '/app'"
21
22
  route "root :to => 'home#index'"
22
23
  end
23
24
 
@@ -7,6 +7,14 @@ If you DO NOT use database, you MUST comment the line below in config/applicatio
7
7
  # require "active_record/railtie"
8
8
 
9
9
  Step 1.
10
+ UNCOMMENT the line below in Gemfile
11
+ gem 'therubyracer', :platforms => :ruby
12
+
13
+ Step 2.
14
+ $ bundle
15
+
16
+
17
+ Step 3.
10
18
  $ rails server
11
19
 
12
20
  ===============================================================================
@@ -1,6 +1,4 @@
1
1
  class ApplicationController < ActionController::Base
2
2
  protect_from_forgery
3
- helper ShopqiApp::ApplicationHelper
4
- include ShopqiApp::ApplicationHelper
5
3
  prepend_before_filter :authenticate_shop!
6
4
  end
data/lib/shopqi-app.rb CHANGED
@@ -6,6 +6,6 @@ require 'settingslogic'
6
6
  require 'omniauth-shopqi'
7
7
  require 'shopkit'
8
8
 
9
- module ShopqiApp
9
+ module ShopQiApp
10
10
  autoload :Helpers, "shopqi_app/helpers"
11
11
  end
@@ -1,6 +1,7 @@
1
- module ShopqiApp
1
+ module ShopQiApp
2
2
  class Engine < Rails::Engine
3
- isolate_namespace ShopqiApp
3
+ isolate_namespace ShopQiApp
4
+ engine_name 'shopqi_app'
4
5
 
5
6
  config.generators do |g|
6
7
  g.template_engine :haml
@@ -8,10 +9,15 @@ module ShopqiApp
8
9
  g.integration_tool :rspec
9
10
  end
10
11
 
12
+ initializer "shopqi_app.acronym" do
13
+ ActiveSupport::Inflector.inflections do |inflect|
14
+ inflect.acronym 'ShopQi'
15
+ end
16
+ end
11
17
 
12
18
  initializer "shopqi_app.helpers" do
13
19
  ActiveSupport.on_load(:action_controller) do
14
- include ShopqiApp::Helpers
20
+ include ShopQiApp::Helpers
15
21
  end
16
22
  end
17
23
  end
@@ -1,8 +1,8 @@
1
- module ShopqiApp
1
+ module ShopQiApp
2
2
  module Helpers
3
3
  def self.included(base)
4
- base.send :helper, ShopqiApp::ApplicationHelper
5
- base.send :include, ShopqiApp::ApplicationHelper
4
+ base.send :helper, ShopQiApp::ApplicationHelper
5
+ base.send :include, ShopQiApp::ApplicationHelper
6
6
  end
7
7
  end
8
8
  end
@@ -1,3 +1,3 @@
1
- module ShopqiApp
2
- VERSION = "0.1.1"
1
+ module ShopQiApp
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopqi-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-03 00:00:00.000000000 Z
12
+ date: 2012-07-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 3.1.4
21
+ version: 3.2.6
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 3.1.4
29
+ version: 3.2.6
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: omniauth-shopqi
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -186,7 +186,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
186
186
  version: '0'
187
187
  segments:
188
188
  - 0
189
- hash: 850028705
189
+ hash: 62860785
190
190
  required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  none: false
192
192
  requirements:
@@ -195,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  version: '0'
196
196
  segments:
197
197
  - 0
198
- hash: 850028705
198
+ hash: 62860785
199
199
  requirements: []
200
200
  rubyforge_project:
201
201
  rubygems_version: 1.8.24