omniauth-scaffold 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -15,17 +15,17 @@ gem 'omniauth-twitter'
15
15
 
16
16
  Execute:
17
17
 
18
- $ bundle
18
+ bundle
19
19
 
20
20
  Or install it yourself as:
21
21
 
22
- $ gem install omniauth-scaffold
22
+ gem install omniauth-scaffold
23
23
 
24
24
  ## Usage
25
25
 
26
26
  Generate omniauth scaffold:
27
27
 
28
- $ rails g omniauth:scaffold
28
+ rails g omniauth:scaffold
29
29
 
30
30
  Edit: config/initializers/constants.rb
31
31
 
@@ -84,11 +84,11 @@ Facebook
84
84
 
85
85
  Migration:
86
86
 
87
- $ rake db:migrate
87
+ rake db:migrate
88
88
 
89
89
  Start Server:
90
90
 
91
- $ rails s
91
+ rails s
92
92
 
93
93
  ## Contributing
94
94
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.8
1
+ 0.1.9
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  require 'rails/generators'
2
3
 
3
4
  module Omniauth
@@ -9,8 +10,23 @@ module Omniauth
9
10
 
10
11
  def generate_scaffold
11
12
  # Config
13
+ if File.exist?('config/initializers/local_setting.rb')
14
+ content = "\n# Twitter\n"
15
+ content += "ENV['TWITTER_KEY'] = \"YOUR_CONSUMER_KEY\"\n"
16
+ content += "ENV['TWITTER_SECRET'] = \"YOUR_CONSUMER_SECRET\"\n\n"
17
+ content += "# GitHub\n"
18
+ content += "#ENV['GITHUB_CLIENT_ID'] = \"YOUR_CLIENT_ID\"\n"
19
+ content += "#ENV['GITHUB_SECRET'] = \"YOUR_SECRET\"\n\n"
20
+ content += "# Facebook\n"
21
+ content += "#ENV['FACEBOOK_APP_ID'] = \"YOUR_APP_ID\"\n"
22
+ content += "#ENV['FACEBOOK_APP_SECRET'] = \"YOUR_APP_SECRET\"\n"
23
+
24
+ append_file "config/initializers/local_setting.rb", content.force_encoding('ASCII-8BIT')
25
+ else
26
+ copy_file "config/initializers/local_setting.rb", "config/initializers/local_setting.rb"
27
+ end
28
+
12
29
  copy_file "config/initializers/omniauth.rb", "config/initializers/omniauth.rb"
13
- copy_file "config/initializers/local_setting.rb", "config/initializers/local_setting.rb"
14
30
  copy_file "config/initializers/constants.rb", "config/initializers/constants.rb"
15
31
 
16
32
  insert_into_file "config/routes.rb", " match \"/auth/:provider/callback\" => \"sessions#callback\"\n match \"/auth/failure\" => \"sessions#failure\"\n match \"/logout\" => \"sessions#destroy\", :as => :logout\n", after: "# first created -> highest priority.\n"
@@ -1,6 +1,6 @@
1
1
  # APP_NAME
2
2
 
3
- APP_DESCRIPTION
3
+ APP_DESCRIPTION.
4
4
 
5
5
  ## Local Setting
6
6
 
@@ -11,12 +11,12 @@ APP_DESCRIPTION
11
11
  ### リポジトリをローカルへ作成
12
12
 
13
13
  $ cd ~/WORK_DIRECTORY
14
- $ git clone git@github.com:MY_USER_NAME/APP_NAME.git
14
+ $ git clone git@github.com:YOUR_USER_NAME/APP_NAME.git
15
15
  $ cd APP_NAME
16
16
 
17
17
  ### ブランチ作成
18
18
 
19
- $ git checkout -b MY_NEW_BRANCH
19
+ $ git checkout -b YOUR_NEW_BRANCH
20
20
 
21
21
  ### Twitterアプリ登録
22
22
 
@@ -33,7 +33,7 @@ APP_DESCRIPTION
33
33
 
34
34
  ### ローカル用Twitterキー設定
35
35
 
36
- Edit: config/initializers/local_setting.rb
36
+ Create: config/initializers/local_setting.rb
37
37
 
38
38
  # Twitter OAuth Local Setting
39
39
  ENV['TWITTER_KEY'] = "YOUR_CONSUMER_KEY"
@@ -45,7 +45,7 @@ Edit: config/initializers/local_setting.rb
45
45
 
46
46
  Gemインストール
47
47
 
48
- bundle install
48
+ bundle install --without production
49
49
 
50
50
  ローカルDB作成
51
51
 
@@ -61,4 +61,4 @@ Gemインストール
61
61
 
62
62
  ## Copyright
63
63
 
64
- Copyright (c) 2012 MY NAME. <a href="http://creativecommons.org/licenses/by-nc-sa/2.1/jp/" target="_blank">CC BY-NC-SA 2.1</a>
64
+ Copyright (c) 2012 MY_NAME. <a href="http://creativecommons.org/licenses/by-nc-sa/2.1/jp/" target="_blank">CC BY-NC-SA 2.1</a>
@@ -11,6 +11,7 @@
11
11
  <%# ----- 追加 ----- %>
12
12
  <% if current_user %>
13
13
  <%# ログイン済み %>
14
+ <%= link_to_unless( current_user.screen_name.blank?, image_tag( current_user.image, size: "20x20" ), "https://twitter.com/#!/#{current_user.screen_name}", target: "_blank" ) %>
14
15
  <%= current_user.name %> :
15
16
  || <%= link_to "Logout" , logout_path %>
16
17
  <% else %>
@@ -24,6 +25,13 @@
24
25
  <%# ----- /追加 ----- %>
25
26
 
26
27
  <%= yield %>
28
+ <br />
29
+ <br />
30
+
31
+ <center>
32
+ Developed by <a href="https://twitter.com/#!/PROGRAMMER_ID/" target="_blank">PROGRAMMER_NAME</a>, Designed by <a href="https://twitter.com/#!/DESIGNER_ID/" target="_blank">DESIGNER_NAME</a><br />
33
+ Licence by <a href="http://creativecommons.org/licenses/by-nc-sa/2.1/jp/" target="_blank">CC BY-NC-SA 2.1</a>
34
+ </center>
27
35
 
28
36
  </body>
29
37
  </html>
@@ -1,3 +1,5 @@
1
+ # coding: utf-8
2
+
1
3
  # Twitter
2
4
  ENV['TWITTER_KEY'] = "YOUR_CONSUMER_KEY"
3
5
  ENV['TWITTER_SECRET'] = "YOUR_CONSUMER_SECRET"
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "omniauth-scaffold"
8
- s.version = "0.1.8"
8
+ s.version = "0.1.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Shun Matsumoto"]
12
- s.date = "2012-04-29"
12
+ s.date = "2012-05-12"
13
13
  s.description = "Scaffold for OmniAuth."
14
14
  s.email = "s.matsumoto0115@gmail.com"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
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-04-29 00:00:00.000000000 Z
12
+ date: 2012-05-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth-twitter
@@ -153,7 +153,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
153
153
  version: '0'
154
154
  segments:
155
155
  - 0
156
- hash: -1847677663337981583
156
+ hash: 3902906257262628515
157
157
  required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  none: false
159
159
  requirements: