omniauth-scaffold 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +63 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/generators/omniauth/scaffold/scaffold_generator.rb +4 -3
- data/lib/generators/omniauth/scaffold/templates/README.md +74 -0
- data/omniauth-scaffold.gemspec +5 -5
- metadata +6 -6
- data/README.rdoc +0 -19
- data/lib/generators/omniauth/scaffold/templates/README.rdoc +0 -83
data/README.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# OmniAuth Scaffold
|
2
|
+
|
3
|
+
Scaffold for OmniAuth.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'omniauth-scaffold'
|
11
|
+
gem 'omniauth-twitter'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
|
16
|
+
$ bundle
|
17
|
+
|
18
|
+
Or install it yourself as:
|
19
|
+
|
20
|
+
$ gem install omniauth-scaffold
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
Generate omniauth scaffold:
|
25
|
+
|
26
|
+
$ rails g omniauth:scaffold
|
27
|
+
|
28
|
+
Edit: config/initializers/constants.rb
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
APP_NAME = "YOUR_APP_NAME"
|
32
|
+
```
|
33
|
+
|
34
|
+
[ Development ]
|
35
|
+
Edit: config/initializers/local_setting.rb
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
ENV['TWITTER_KEY'] = "YOUR_CONSUMER_KEY"
|
39
|
+
ENV['TWITTER_SECRET'] = "YOUR_CONSUMER_SECRET"
|
40
|
+
```
|
41
|
+
|
42
|
+
[ Production ]
|
43
|
+
Edit: config/initializers/omniauth.rb
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
47
|
+
provider :developer unless Rails.env.production?
|
48
|
+
provider :twitter, ENV['TWITTER_KEY'], ENV['TWITTER_SECRET']
|
49
|
+
end
|
50
|
+
```
|
51
|
+
|
52
|
+
## Contributing
|
53
|
+
|
54
|
+
1. Fork it
|
55
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
56
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
57
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
58
|
+
5. Create new Pull Request
|
59
|
+
|
60
|
+
## Copyright
|
61
|
+
|
62
|
+
Copyright (c) 2012 Shun Matsumoto. See LICENSE.txt for
|
63
|
+
further details.
|
data/Rakefile
CHANGED
@@ -18,7 +18,7 @@ Jeweler::Tasks.new do |gem|
|
|
18
18
|
gem.homepage = "http://github.com/shu0115/omniauth-scaffold"
|
19
19
|
gem.license = "MIT"
|
20
20
|
gem.summary = "OmniAuth Scaffold"
|
21
|
-
gem.description = "Scaffold
|
21
|
+
gem.description = "Scaffold for OmniAuth."
|
22
22
|
gem.email = "s.matsumoto0115@gmail.com"
|
23
23
|
gem.authors = ["Shun Matsumoto"]
|
24
24
|
# dependencies defined in Gemfile
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
@@ -5,7 +5,7 @@ module Omniauth
|
|
5
5
|
class ScaffoldGenerator < ::Rails::Generators::Base
|
6
6
|
|
7
7
|
source_root File.expand_path("../templates", __FILE__)
|
8
|
-
desc "This generator scaffold
|
8
|
+
desc "This generator scaffold for OmniAuth"
|
9
9
|
|
10
10
|
def generate_scaffold
|
11
11
|
copy_file "config/initializers/omniauth.rb", "config/initializers/omniauth.rb"
|
@@ -13,7 +13,7 @@ module Omniauth
|
|
13
13
|
copy_file "config/initializers/constants.rb", "config/initializers/constants.rb"
|
14
14
|
|
15
15
|
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"
|
16
|
-
insert_into_file "config/routes.rb", " root :
|
16
|
+
insert_into_file "config/routes.rb", " root to: 'top#index'\n", after: "# root :to => 'welcome#index'\n"
|
17
17
|
insert_into_file "config/routes.rb", " match ':controller(/:action(/:id))(.:format)'\n", after: "# match ':controller(/:action(/:id))(.:format)'\n"
|
18
18
|
|
19
19
|
copy_file "db/migrate/create_users.rb", "db/migrate/20000101000000_create_users.rb"
|
@@ -25,7 +25,8 @@ module Omniauth
|
|
25
25
|
copy_file "app/views/top/index.html.erb", "app/views/top/index.html.erb"
|
26
26
|
|
27
27
|
remove_file 'public/index.html'
|
28
|
-
|
28
|
+
remove_file 'README.rdoc'
|
29
|
+
copy_file "README.md", "README.md"
|
29
30
|
|
30
31
|
insert_into_file ".gitignore", "\n# Add\n.DS_Store\n/config/initializers/local_setting.rb\n", after: "/tmp\n"
|
31
32
|
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# APP_NAME
|
2
|
+
|
3
|
+
APP_DESCRIPTION
|
4
|
+
|
5
|
+
## Local Setting
|
6
|
+
|
7
|
+
### GitHub上でFork
|
8
|
+
|
9
|
+
https://github.com/USER_NAME/APP_NAME/
|
10
|
+
|
11
|
+
### リポジトリをローカルへ作成
|
12
|
+
|
13
|
+
$ cd ~/WORK_DIRECTORY
|
14
|
+
$ git clone git@github.com:MY_USER_NAME/APP_NAME.git
|
15
|
+
$ cd APP_NAME
|
16
|
+
|
17
|
+
### ブランチ作成
|
18
|
+
|
19
|
+
$ git checkout -b MY_NEW_BRANCH
|
20
|
+
|
21
|
+
### Twitterアプリ登録
|
22
|
+
|
23
|
+
https://dev.twitter.com/apps/new
|
24
|
+
|
25
|
+
Name: [ (アプリケーションの名前) ]
|
26
|
+
Description: [ (アプリケーションの説明) ]
|
27
|
+
WebSite: [ http://0.0.0.0:3000/ ]
|
28
|
+
Callback URL: [ http://0.0.0.0:3000/ ] ※登録しないと動かない
|
29
|
+
|
30
|
+
□ Yes, I agree <= チェック
|
31
|
+
|
32
|
+
CAPTCHA入力後「Create your Twitter application」を押下
|
33
|
+
|
34
|
+
### ローカル用Twitterキー設定
|
35
|
+
|
36
|
+
Edit: config/initializers/local_setting.rb
|
37
|
+
|
38
|
+
# Twitter OAuth Local Setting
|
39
|
+
ENV['TWITTER_KEY'] = "YOUR_CONSUMER_KEY"
|
40
|
+
ENV['TWITTER_SECRET'] = "YOUR_CONSUMER_SECRET"
|
41
|
+
|
42
|
+
※Twitterアプリ登録完了後に表示された「Consumer key」を「YOUR_CONSUMER_KEY」に、「Consumer secret」を「YOUR\_CONSUMER_SECRET」にそれぞれ入力
|
43
|
+
|
44
|
+
### 定数定義設定
|
45
|
+
|
46
|
+
アプリ名設定
|
47
|
+
|
48
|
+
Edit: config/initializers/constants.rb
|
49
|
+
|
50
|
+
APP_NAME = "YOUR_APP_NAME"
|
51
|
+
|
52
|
+
※「YOUR\_APP_NAME」を自分の作成したアプリ名に修正
|
53
|
+
|
54
|
+
### Rails起動
|
55
|
+
|
56
|
+
Gemインストール
|
57
|
+
|
58
|
+
bundle install
|
59
|
+
|
60
|
+
ローカルDB作成
|
61
|
+
|
62
|
+
rake db:migrate
|
63
|
+
|
64
|
+
ローカルサーバ起動
|
65
|
+
|
66
|
+
bundle exec rails s
|
67
|
+
|
68
|
+
ページアクセス
|
69
|
+
|
70
|
+
http://0.0.0.0:3000/
|
71
|
+
|
72
|
+
## Copyright
|
73
|
+
|
74
|
+
Copyright (c) 2012 MY NAME.
|
data/omniauth-scaffold.gemspec
CHANGED
@@ -5,27 +5,27 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "omniauth-scaffold"
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.4"
|
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
12
|
s.date = "2012-04-27"
|
13
|
-
s.description = "Scaffold
|
13
|
+
s.description = "Scaffold for OmniAuth."
|
14
14
|
s.email = "s.matsumoto0115@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE.txt",
|
17
|
-
"README.
|
17
|
+
"README.md"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
20
|
".document",
|
21
21
|
".rspec",
|
22
22
|
"Gemfile",
|
23
23
|
"LICENSE.txt",
|
24
|
-
"README.
|
24
|
+
"README.md",
|
25
25
|
"Rakefile",
|
26
26
|
"VERSION",
|
27
27
|
"lib/generators/omniauth/scaffold/scaffold_generator.rb",
|
28
|
-
"lib/generators/omniauth/scaffold/templates/README.
|
28
|
+
"lib/generators/omniauth/scaffold/templates/README.md",
|
29
29
|
"lib/generators/omniauth/scaffold/templates/app/controllers/application_controller.rb",
|
30
30
|
"lib/generators/omniauth/scaffold/templates/app/controllers/sessions_controller.rb",
|
31
31
|
"lib/generators/omniauth/scaffold/templates/app/controllers/top_controller.rb",
|
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.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -107,23 +107,23 @@ dependencies:
|
|
107
107
|
- - ~>
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: 1.8.3
|
110
|
-
description: Scaffold
|
110
|
+
description: Scaffold for OmniAuth.
|
111
111
|
email: s.matsumoto0115@gmail.com
|
112
112
|
executables: []
|
113
113
|
extensions: []
|
114
114
|
extra_rdoc_files:
|
115
115
|
- LICENSE.txt
|
116
|
-
- README.
|
116
|
+
- README.md
|
117
117
|
files:
|
118
118
|
- .document
|
119
119
|
- .rspec
|
120
120
|
- Gemfile
|
121
121
|
- LICENSE.txt
|
122
|
-
- README.
|
122
|
+
- README.md
|
123
123
|
- Rakefile
|
124
124
|
- VERSION
|
125
125
|
- lib/generators/omniauth/scaffold/scaffold_generator.rb
|
126
|
-
- lib/generators/omniauth/scaffold/templates/README.
|
126
|
+
- lib/generators/omniauth/scaffold/templates/README.md
|
127
127
|
- lib/generators/omniauth/scaffold/templates/app/controllers/application_controller.rb
|
128
128
|
- lib/generators/omniauth/scaffold/templates/app/controllers/sessions_controller.rb
|
129
129
|
- lib/generators/omniauth/scaffold/templates/app/controllers/top_controller.rb
|
@@ -152,7 +152,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
152
152
|
version: '0'
|
153
153
|
segments:
|
154
154
|
- 0
|
155
|
-
hash:
|
155
|
+
hash: 1529499676903483408
|
156
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
157
|
none: false
|
158
158
|
requirements:
|
data/README.rdoc
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
= omniauth-scaffold
|
2
|
-
|
3
|
-
Scaffold to use OmniAuth.
|
4
|
-
|
5
|
-
== Contributing to omniauth-scaffold
|
6
|
-
|
7
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
8
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
9
|
-
* Fork the project.
|
10
|
-
* Start a feature/bugfix branch.
|
11
|
-
* Commit and push until you are happy with your contribution.
|
12
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
-
|
15
|
-
== Copyright
|
16
|
-
|
17
|
-
Copyright (c) 2012 Shun Matsumoto. See LICENSE.txt for
|
18
|
-
further details.
|
19
|
-
|
@@ -1,83 +0,0 @@
|
|
1
|
-
= APP_NAME
|
2
|
-
|
3
|
-
APP_DESCRIPTION
|
4
|
-
|
5
|
-
= Local Setting
|
6
|
-
|
7
|
-
・参考
|
8
|
-
|
9
|
-
作業ディレクトリ:「~/labo」
|
10
|
-
「$ 〜」: コマンド
|
11
|
-
|
12
|
-
※「$」は入力不要
|
13
|
-
|
14
|
-
・vi操作方法
|
15
|
-
「$ vi ファイル名」
|
16
|
-
[ i ]:入力モードへ移行
|
17
|
-
[ ESC ]:コマンドモードへ移行
|
18
|
-
[ :wq ]:保存して終了
|
19
|
-
|
20
|
-
=== リポジトリをローカルへ作成
|
21
|
-
|
22
|
-
$ cd ~/labo
|
23
|
-
|
24
|
-
$ git clone git@github.com:shu0115/APP_NAME.git
|
25
|
-
$ cd APP_NAME
|
26
|
-
|
27
|
-
=== Twitterアプリ登録
|
28
|
-
|
29
|
-
https://dev.twitter.com/apps/new
|
30
|
-
|
31
|
-
Name: [ (アプリケーションの名前) ]
|
32
|
-
Description: [ (アプリケーションの説明) ]
|
33
|
-
WebSite: [ http://0.0.0.0:3000/ ]
|
34
|
-
Callback URL: [ http://0.0.0.0:3000/ ] ※登録しないと動かない
|
35
|
-
|
36
|
-
□ Yes, I agree <= チェック
|
37
|
-
|
38
|
-
CAPTCHA入力後「Create your Twitter application」を押下
|
39
|
-
|
40
|
-
=== ローカル用Twitterキー設定
|
41
|
-
|
42
|
-
$ vi config/initializers/local_setting.rb
|
43
|
-
-----
|
44
|
-
# Twitter OAuth Local Setting
|
45
|
-
ENV['TWITTER_KEY'] = "YOUR_CONSUMER_KEY"
|
46
|
-
ENV['TWITTER_SECRET'] = "YOUR_CONSUMER_SECRET"
|
47
|
-
-----
|
48
|
-
|
49
|
-
※Twitterアプリ登録完了後に表示された「Consumer key」を「YOUR_CONSUMER_KEY」に、「Consumer secret」を「YOUR_CONSUMER_SECRET」にそれぞれ入力する
|
50
|
-
|
51
|
-
=== 定数定義設定
|
52
|
-
|
53
|
-
・アプリ名設定
|
54
|
-
|
55
|
-
$ vi config/initializers/constants.rb
|
56
|
-
-----
|
57
|
-
# ---------- 共通定義 ---------- #
|
58
|
-
APP_NAME = "YOUR_APP_NAME"
|
59
|
-
-----
|
60
|
-
|
61
|
-
※「YOUR_APP_NAME」を自分のアプリ名に修正
|
62
|
-
|
63
|
-
=== Rails起動
|
64
|
-
|
65
|
-
・Gemインストール
|
66
|
-
|
67
|
-
bundle install
|
68
|
-
|
69
|
-
・ローカルDB作成
|
70
|
-
|
71
|
-
rake db:migrate
|
72
|
-
|
73
|
-
・ローカルサーバ起動
|
74
|
-
|
75
|
-
bundle exec rails s
|
76
|
-
|
77
|
-
・ページアクセス
|
78
|
-
|
79
|
-
http://0.0.0.0:3000/
|
80
|
-
|
81
|
-
= Copyright
|
82
|
-
|
83
|
-
Copyright (c) 2012 Shun Matsumoto.
|