wired 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/README.md +6 -0
- data/Rakefile +2 -0
- data/bin/wired +5 -10
- data/lib/wired/app_builder.rb +73 -21
- data/lib/wired/generators/app_generator.rb +16 -4
- data/lib/wired/version.rb +1 -1
- data/templates/Gemfile_clean +14 -7
- data/templates/README.md.erb +2 -0
- data/templates/facebook/_variables.css.scss +173 -0
- data/templates/facebook/cookie_fix.js.coffee +3 -0
- data/templates/facebook/env +3 -0
- data/templates/facebook/export_controller.rb +1 -1
- data/templates/facebook/facebook.js.coffee +19 -0
- data/templates/facebook/reset.css.scss +68 -0
- data/templates/facebook/sessions_controller.rb +1 -1
- data/templates/facebook/tab_controller.rb +9 -4
- data/templates/layout.html.erb.erb +3 -2
- data/wired.gemspec +2 -2
- metadata +15 -12
- data/templates/facebook/powenv +0 -2
- data/templates/facebook/safari-cookie-fix.js.coffee +0 -4
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
YmM4YmIwNGNlMGJiZWE1MGVjNGQ5ZDhkZjFkZjI5ZjdmODA4ZmFhZTJiOGJl
|
10
|
-
MmNkZWI3N2M3MmQyMjA4MjM4MjRlZTQ1ZDUyMjZlZDk0ODFjYTcwZGViNGJj
|
11
|
-
NWUwYzFkOGM4OWFhYmY1NjEzMzEzZTI5ZTBlOWQ1MjYzNTA5NDE=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
YWRiNmQ4MzE1YTk4NjNiZjFiZWExY2YzOTlmYTRhYzk0ZTE5NGJmZjg1MzFl
|
14
|
-
OGJiZDkyNWU4ODQyYWRlZDg4ZjRlN2YzNmE4NWJkMjBmMjBlZDVhMWQ1OGZi
|
15
|
-
ZWMyOWNjMjJkZTA5NjJjNDdhNjI2MzAzZWY3MGYzN2ViZDU3OTc=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 75a42c0378f69059ddf6c380b5f774104e9848b0
|
4
|
+
data.tar.gz: ace85e31fdc62ded6053df508890dc32587a90fd
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b3687404a68b0de91cc8f302fc79ff4ebf5f89daff9a0255734ba3875031e98899c9e70af27dec650487ef517468342518d55a5f42ba1616a524958130959f40
|
7
|
+
data.tar.gz: af62779ca135d3692e2498848abbfb905d0f8a0667cc1ca9fc0b16dc5cae5acebbc45fd5fdb432361622f4880da70a9d631e756a0fa9bddfe5bd6d03b83fe4de
|
data/README.md
CHANGED
@@ -17,3 +17,9 @@ Usage
|
|
17
17
|
---
|
18
18
|
`wired app_name`
|
19
19
|
|
20
|
+
Params additional to the default rails generator params are:
|
21
|
+
|
22
|
+
* --skip-heroku _Skips the creation of the Heroku apps_
|
23
|
+
* --skip-github _Skips the creation of a Github repository_
|
24
|
+
|
25
|
+
For a complete list of options check `wired --help`.
|
data/Rakefile
ADDED
data/bin/wired
CHANGED
@@ -1,14 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
if ARGV.
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
raise "Name needs to be longer than 3 characters. (#{ARGV[0]} is #{ARGV[0].length})"
|
8
|
-
end
|
9
|
-
|
10
|
-
if ARGV[0].length > 20
|
11
|
-
raise "Name can't be longer than 20 characters. (#{ARGV[0]} is #{ARGV[0].length})"
|
2
|
+
#
|
3
|
+
if ARGV.any?
|
4
|
+
if ARGV[0].length < 3 || ARGV[0].length > 20
|
5
|
+
puts "Name needs to be between 3 and 20 characters. (#{ARGV[0]} is #{ARGV[0].length})"
|
6
|
+
exit
|
12
7
|
end
|
13
8
|
end
|
14
9
|
|
data/lib/wired/app_builder.rb
CHANGED
@@ -18,6 +18,10 @@ module Wired
|
|
18
18
|
remove_file 'app/assets/images/rails.png'
|
19
19
|
end
|
20
20
|
|
21
|
+
def remove_turbo_links
|
22
|
+
replace_in_file "app/assets/javascripts/application.js", /\/\/= require turbolinks\n/, ''
|
23
|
+
end
|
24
|
+
|
21
25
|
def replace_gemfile
|
22
26
|
remove_file 'Gemfile'
|
23
27
|
copy_file 'Gemfile_clean', 'Gemfile'
|
@@ -41,7 +45,7 @@ module Wired
|
|
41
45
|
end
|
42
46
|
|
43
47
|
def generate_user_model
|
44
|
-
run 'rails g model User name email fbid'
|
48
|
+
run 'rails g model User name:string email:string fbid:string'
|
45
49
|
end
|
46
50
|
|
47
51
|
def create_partials_directory
|
@@ -67,6 +71,14 @@ module Wired
|
|
67
71
|
inject_into_class 'config/application.rb', 'Application', config
|
68
72
|
end
|
69
73
|
|
74
|
+
def set_asset_sync
|
75
|
+
config = <<-RUBY
|
76
|
+
config.action_controller.asset_host = ENV["CUSTOM_ASSET_HOST"]
|
77
|
+
RUBY
|
78
|
+
inject_into_class 'config/application.rb', 'Application', config
|
79
|
+
inject_into_file 'config/environments/production.rb', config, :after => "config.action_controller.asset_host = \"http://assets.example.com\"\n"
|
80
|
+
end
|
81
|
+
|
70
82
|
def customize_error_pages
|
71
83
|
meta_tags =<<-EOS
|
72
84
|
<meta charset='utf-8' />
|
@@ -102,7 +114,7 @@ module Wired
|
|
102
114
|
'spec/support/mixins',
|
103
115
|
'spec/support/shared_examples'
|
104
116
|
].each do |dir|
|
105
|
-
|
117
|
+
empty_directory_with_keep_file dir
|
106
118
|
end
|
107
119
|
end
|
108
120
|
|
@@ -114,13 +126,21 @@ module Wired
|
|
114
126
|
end
|
115
127
|
|
116
128
|
def deploy_github
|
117
|
-
run "hub create -p wirelab/#{app_name}"
|
129
|
+
github_result = run "hub create -p wirelab/#{app_name}"
|
130
|
+
if github_result
|
131
|
+
puts "Github repo wirelab/#{app_name} created."
|
132
|
+
else
|
133
|
+
puts "Github creation wirelab/#{app_name} failed."
|
134
|
+
puts "Wired generation halted due to error."
|
135
|
+
puts "You might want to remove the created Rails app and retry."
|
136
|
+
exit
|
137
|
+
end
|
118
138
|
run "git push --all"
|
119
139
|
end
|
120
140
|
|
121
141
|
def powder_setup
|
122
142
|
run 'powder link'
|
123
|
-
copy_file 'facebook/
|
143
|
+
copy_file 'facebook/env', '.env'
|
124
144
|
end
|
125
145
|
|
126
146
|
def update_readme_for_facebook
|
@@ -141,9 +161,8 @@ module Wired
|
|
141
161
|
def add_facebook_routes
|
142
162
|
facebook_routes =<<-ROUTES
|
143
163
|
root :to => 'tab#home'
|
144
|
-
|
145
|
-
|
146
|
-
#safari cookie fix
|
164
|
+
post '/' => 'tab#home'
|
165
|
+
|
147
166
|
get 'cookie' => 'sessions#cookie', as: 'cookie'
|
148
167
|
|
149
168
|
#admin
|
@@ -156,6 +175,12 @@ module Wired
|
|
156
175
|
copy_file 'facebook/tab_controller.rb', 'app/controllers/tab_controller.rb'
|
157
176
|
copy_file 'facebook/export_controller.rb', 'app/controllers/export_controller.rb'
|
158
177
|
end
|
178
|
+
|
179
|
+
def add_facebook_stylesheets
|
180
|
+
say 'Copy stylesheets'
|
181
|
+
copy_file 'facebook/reset.css.scss', 'app/assets/stylesheets/resets.css.scss'
|
182
|
+
copy_file 'facebook/_variables.css.scss', 'app/assets/stylesheets/_variables.css.scss'
|
183
|
+
end
|
159
184
|
|
160
185
|
def add_facebook_channel_file
|
161
186
|
copy_file 'facebook/channel.html', 'public/channel.html'
|
@@ -163,48 +188,75 @@ module Wired
|
|
163
188
|
|
164
189
|
def create_facebook_views
|
165
190
|
empty_directory 'app/views/tab'
|
166
|
-
|
167
|
-
|
168
|
-
|
191
|
+
home_page =<<-HOME
|
192
|
+
Home pagina, show fangate: <%= @show_fangate %>
|
193
|
+
HOME
|
194
|
+
File.open("app/views/tab/home.html.erb", 'w') { |file| file.write(home_page) }
|
169
195
|
end
|
170
196
|
|
171
|
-
def
|
197
|
+
def add_cookie_fix
|
172
198
|
copy_file 'facebook/sessions_controller.rb', 'app/controllers/sessions_controller.rb'
|
173
199
|
copy_file 'facebook/cookie.html.erb', 'app/views/sessions/cookie.html.erb'
|
174
200
|
facebook_cookie_fix =<<-COOKIE_FIX
|
175
201
|
helper_method :current_user
|
176
|
-
before_filter :
|
202
|
+
before_filter :cookie_fix
|
177
203
|
before_filter :add_global_javascript_variables
|
178
|
-
|
204
|
+
before_filter :set_origin
|
205
|
+
before_filter :set_p3p
|
206
|
+
|
179
207
|
def cookie
|
180
|
-
#
|
208
|
+
# third party cookie fix
|
181
209
|
end
|
182
210
|
|
183
211
|
private
|
212
|
+
def set_p3p
|
213
|
+
headers['P3P'] = 'CP="ALL DSP COR CURa ADMa DEVa OUR IND COM NAV"'
|
214
|
+
end
|
215
|
+
|
216
|
+
def set_origin
|
217
|
+
response.headers["Access-Control-Allow-Origin: facebook.com"]
|
218
|
+
end
|
184
219
|
|
185
220
|
def current_user
|
186
221
|
@current_user ||= User.find_by_fbid session[:fbid]
|
187
222
|
end
|
188
223
|
|
189
|
-
def
|
190
|
-
cookies[:
|
224
|
+
def cookie_fix
|
225
|
+
cookies[:cookie_fix] = "cookie" #third party cookie fix
|
191
226
|
end
|
192
227
|
|
193
228
|
def add_global_javascript_variables
|
194
229
|
Gon.global.facebook = { 'app_id' => ENV["FB_APP_ID"] }
|
195
|
-
Gon.global.current_user = current_user
|
230
|
+
Gon.global.current_user = current_user.fbid if current_user.present?
|
196
231
|
end
|
197
232
|
COOKIE_FIX
|
198
233
|
inject_into_file "app/controllers/application_controller.rb", facebook_cookie_fix, :before => "end"
|
199
|
-
copy_file 'facebook/
|
234
|
+
copy_file 'facebook/cookie_fix.js.coffee', 'app/assets/javascripts/cookie_fix.js.coffee'
|
235
|
+
copy_file 'facebook/facebook.js.coffee', 'app/assets/javascripts/facebook.js.coffee'
|
236
|
+
end
|
237
|
+
|
238
|
+
def add_javascripts_to_manifest
|
239
|
+
inject_into_file 'app/assets/javascripts/application.js', "//= require facebook\n", :before => '//= require_tree .'
|
240
|
+
inject_into_file 'app/assets/javascripts/application.js', "//= require cookie_fix\n", :before => '//= require_tree .'
|
200
241
|
end
|
201
242
|
|
202
243
|
def create_heroku_apps
|
203
244
|
%w(staging acceptance production).each do |env|
|
204
|
-
|
205
|
-
|
245
|
+
heroku_name = (env == "production") ? app_name : "#{app_name}-#{env}"
|
246
|
+
heroku_result = run "heroku create #{heroku_name} --remote=#{env} --region eu"
|
247
|
+
|
248
|
+
if heroku_result
|
249
|
+
puts "Heroku app #{heroku_name} created."
|
206
250
|
else
|
207
|
-
|
251
|
+
puts "Heroku app #{heroku_name} failed."
|
252
|
+
puts "Wired generation halted due to error."
|
253
|
+
puts "You might want to remove the GitHub repo and previously created heroku apps and retry."
|
254
|
+
exit
|
255
|
+
end
|
256
|
+
if env == 'production'
|
257
|
+
%w(papertrail pgbackups newrelic memcachier).each do |addon|
|
258
|
+
run "heroku addons:add #{addon} --remote=#{env}"
|
259
|
+
end
|
208
260
|
end
|
209
261
|
end
|
210
262
|
end
|
@@ -3,6 +3,12 @@ require 'rails/generators/rails/app/app_generator'
|
|
3
3
|
|
4
4
|
module Wired
|
5
5
|
class AppGenerator < Rails::Generators::AppGenerator
|
6
|
+
class_option 'skip-heroku', type: :boolean, default: false,
|
7
|
+
desc: 'Skips the creation of the Heroku apps'
|
8
|
+
|
9
|
+
class_option 'skip-github', type: :boolean, default: false,
|
10
|
+
desc: 'Skips the creation of a Github repository'
|
11
|
+
|
6
12
|
@@type = ""
|
7
13
|
|
8
14
|
def finish_template
|
@@ -52,8 +58,10 @@ module Wired
|
|
52
58
|
build :add_facebook_routes
|
53
59
|
build :add_facebook_channel_file
|
54
60
|
build :add_facebook_controllers
|
61
|
+
build :add_facebook_stylesheets
|
55
62
|
build :create_facebook_views
|
56
|
-
build :
|
63
|
+
build :add_cookie_fix
|
64
|
+
build :add_javascripts_to_manifest
|
57
65
|
build :generate_user_model
|
58
66
|
build :run_migrations
|
59
67
|
end
|
@@ -69,6 +77,7 @@ module Wired
|
|
69
77
|
build :remove_doc_folder
|
70
78
|
build :remove_public_index
|
71
79
|
build :remove_rails_logo_image
|
80
|
+
build :remove_turbo_links
|
72
81
|
end
|
73
82
|
|
74
83
|
def customize_gemfile
|
@@ -93,6 +102,7 @@ module Wired
|
|
93
102
|
def configure_app
|
94
103
|
say 'Configuring app'
|
95
104
|
build :configure_time_zone
|
105
|
+
build :set_asset_sync
|
96
106
|
build :add_email_validator
|
97
107
|
end
|
98
108
|
|
@@ -113,12 +123,14 @@ module Wired
|
|
113
123
|
say 'Setting up git'
|
114
124
|
build :gitignore_files
|
115
125
|
build :setup_git
|
116
|
-
build :deploy_github
|
126
|
+
build :deploy_github unless options['skip-github']
|
117
127
|
end
|
118
128
|
|
119
129
|
def create_heroku_apps
|
120
|
-
|
121
|
-
|
130
|
+
unless options['skip-heroku']
|
131
|
+
say 'Creating Heroku apps'
|
132
|
+
build :create_heroku_apps
|
133
|
+
end
|
122
134
|
end
|
123
135
|
|
124
136
|
def outro
|
data/lib/wired/version.rb
CHANGED
data/templates/Gemfile_clean
CHANGED
@@ -1,16 +1,14 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
gem 'rails', '
|
3
|
+
gem 'rails', '4.0.0'
|
4
4
|
|
5
5
|
gem 'pg'
|
6
|
-
gem 'jquery-rails'
|
6
|
+
gem 'jquery-rails', '2.2.1'
|
7
7
|
gem 'thin'
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
gem 'uglifier'
|
13
|
-
end
|
9
|
+
gem 'coffee-rails'
|
10
|
+
gem 'sass-rails'
|
11
|
+
gem 'uglifier'
|
14
12
|
|
15
13
|
group :development do
|
16
14
|
gem 'foreman'
|
@@ -20,8 +18,17 @@ group :development do
|
|
20
18
|
gem 'quiet_assets'
|
21
19
|
end
|
22
20
|
|
21
|
+
group :production do
|
22
|
+
gem 'memcachier'
|
23
|
+
gem 'dalli'
|
24
|
+
gem 'newrelic_rpm'
|
25
|
+
end
|
26
|
+
|
23
27
|
gem 'asset_sync'
|
24
28
|
gem 'mobylette'
|
25
29
|
gem 'simple_form'
|
26
30
|
gem 'flutie'
|
27
31
|
gem 'gon'
|
32
|
+
|
33
|
+
#Use .env instead of .powenv for powder.
|
34
|
+
gem 'dotenv-rails', :groups => [:development, :test]
|
data/templates/README.md.erb
CHANGED
@@ -0,0 +1,173 @@
|
|
1
|
+
$white: #fff;
|
2
|
+
$black: #000;
|
3
|
+
$grey: #7d7d7d;
|
4
|
+
$red: #ff0000;
|
5
|
+
|
6
|
+
$blue: #3abad7;
|
7
|
+
/* color */
|
8
|
+
|
9
|
+
$standard-font-size: 14px;
|
10
|
+
$h1-font-size: 48px;
|
11
|
+
$h2-font-size: 18px;
|
12
|
+
$h3-font-size: 16px;
|
13
|
+
$h4-font-size: 14px;
|
14
|
+
/* size */
|
15
|
+
|
16
|
+
$helvetica_light: 'HENTC', 'Open Sans', sans-serif, Arial, Helvetica, sans-serif;
|
17
|
+
$helvetica_bold: 'HENBC', 'Open Sans', sans-serif, Arial, Helvetica, sans-serif;
|
18
|
+
$default_font: Arial, Helvetica, sans-serif;
|
19
|
+
|
20
|
+
//MIXINS
|
21
|
+
$experimental-support-for-svg: true; //ads SVG instead of gradient
|
22
|
+
|
23
|
+
|
24
|
+
@mixin helvetica_light{
|
25
|
+
font-family: $helvetica_light;
|
26
|
+
text-transform: uppercase;
|
27
|
+
}
|
28
|
+
@mixin helvetica_bold{
|
29
|
+
font-family: $helvetica_bold;
|
30
|
+
text-transform: uppercase;
|
31
|
+
}
|
32
|
+
@mixin default_font{
|
33
|
+
font-family: $default_font;
|
34
|
+
text-transform: none;
|
35
|
+
|
36
|
+
}
|
37
|
+
/* fonts */
|
38
|
+
|
39
|
+
$margin-top: 20px 0 0;
|
40
|
+
$margin-bottom: 0 0 20px;
|
41
|
+
/* margin */
|
42
|
+
|
43
|
+
@mixin trans-black {
|
44
|
+
background: rgba(0,0,0,0.6);
|
45
|
+
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#99000000', endColorstr='#99000000',GradientType=0 );
|
46
|
+
}
|
47
|
+
@mixin border-radius($radius) {
|
48
|
+
-webkit-border-radius:$radius;
|
49
|
+
-moz-border-radius: $radius;
|
50
|
+
-ms-border-radius: $radius;
|
51
|
+
-o-border-radius: $radius;
|
52
|
+
border-radius: $radius;
|
53
|
+
}
|
54
|
+
@mixin border-radius-corners($radius1: false, $radius2: false, $radius3: false, $radius4: false) {
|
55
|
+
@if($radius1) {
|
56
|
+
-webkit-border-top-left-radius: $radius1;
|
57
|
+
-moz-border-top-left-radius: $radius1;
|
58
|
+
-ms-border-top-left-radius: $radius1;
|
59
|
+
-o-border-top-left-radius: $radius1;
|
60
|
+
border-top-left-radius: $radius1;
|
61
|
+
}
|
62
|
+
@if($radius2) {
|
63
|
+
-webkit-border-top-right-radius: $radius2;
|
64
|
+
-moz-border-top-right-radius: $radius2;
|
65
|
+
-ms-border-top-right-radius: $radius2;
|
66
|
+
-o-border-top-right-radius: $radius2;
|
67
|
+
border-top-right-radius: $radius2;
|
68
|
+
}
|
69
|
+
@if($radius3) {
|
70
|
+
-webkit-border-bottom-right-radius: $radius3;
|
71
|
+
-moz-border-bottom-right-radius: $radius3;
|
72
|
+
-ms-border-bottom-right-radius: $radius3;
|
73
|
+
-o-border-bottom-right-radius: $radius3;
|
74
|
+
border-bottom-right-radius: $radius3;
|
75
|
+
}
|
76
|
+
@if($radius4) {
|
77
|
+
-webkit-border-bottom-left-radius: $radius4;
|
78
|
+
-moz-border-bottom-left-radius: $radius4;
|
79
|
+
-ms-border-bottom-left-radius: $radius4;
|
80
|
+
-o-border-bottom-left-radius: $radius4;
|
81
|
+
border-bottom-left-radius: $radius4;
|
82
|
+
}
|
83
|
+
}
|
84
|
+
@mixin box-shadow($value){
|
85
|
+
-webkit-box-shadow: $value;
|
86
|
+
-moz-box-shadow: $value;
|
87
|
+
-ms-box-shadow: $value;
|
88
|
+
-o-box-shadow: $value;
|
89
|
+
box-shadow: $value;
|
90
|
+
}
|
91
|
+
@mixin multiple-box-shadow($value, $insetvalue: false){
|
92
|
+
-webkit-box-shadow: $value, $insetvalue;
|
93
|
+
-moz-box-shadow: $value, $insetvalue;
|
94
|
+
-ms-box-shadow: $value, $insetvalue;
|
95
|
+
-o-box-shadow: $value, $insetvalue;
|
96
|
+
box-shadow: $value, $insetvalue;
|
97
|
+
}
|
98
|
+
@mixin text-shadow($value){
|
99
|
+
-webkit-text-shadow: $value;
|
100
|
+
-khtml-text-shadow: $value;
|
101
|
+
-moz-text-shadow: $value;
|
102
|
+
-o-text-shadow: $value;
|
103
|
+
text-shadow: $value;
|
104
|
+
}
|
105
|
+
@mixin transition($property, $duration, $ms: true) {
|
106
|
+
-webkit-transition: $property $duration ease-in-out;
|
107
|
+
-moz-transition: $property $duration ease-in-out;
|
108
|
+
-o-transition: $property $duration ease-in-out;
|
109
|
+
@if ($ms) {
|
110
|
+
-ms-transition: $property $duration ease-in-out;
|
111
|
+
}
|
112
|
+
transition: $property $duration ease-in-out;
|
113
|
+
}
|
114
|
+
@mixin transitionLong($property, $duration, $easing:ease-in-out, $delay:false) {
|
115
|
+
@include transitionProperty($property);
|
116
|
+
@include transitionDuration($duration);
|
117
|
+
@if($delay) {
|
118
|
+
@include transitionDelay($delay);
|
119
|
+
}
|
120
|
+
@if($easing) {
|
121
|
+
@include transitionTimingFunction($easing);
|
122
|
+
}
|
123
|
+
}
|
124
|
+
@mixin transitionDelay($delay) {
|
125
|
+
-webkit-transition-delay: $delay;
|
126
|
+
-moz-transition-delay: $delay;
|
127
|
+
-o-transition-delay: $delay;
|
128
|
+
-ms-transition-delay: $delay;
|
129
|
+
transition-delay: $delay;
|
130
|
+
}
|
131
|
+
@mixin transitionDuration($duration) {
|
132
|
+
-webkit-transition-duration: $duration;
|
133
|
+
-moz-transition-duration: $duration;
|
134
|
+
-o-transition-duration: $duration;
|
135
|
+
-ms-transition-duration: $duration;
|
136
|
+
transition-duration: $duration;
|
137
|
+
}
|
138
|
+
@mixin transitionProperty($property) {
|
139
|
+
-webkit-transition-property: $property;
|
140
|
+
-moz-transition-property: $property;
|
141
|
+
-o-transition-property: $property;
|
142
|
+
-ms-transition-property: $property;
|
143
|
+
transition-property: $property;
|
144
|
+
}
|
145
|
+
@mixin transitionTimingFunction($easing) {
|
146
|
+
-webkit-transition-timing-function: $easing;
|
147
|
+
-moz-transition-timing-function: $easing;
|
148
|
+
-o-transition-timing-function: $easing;
|
149
|
+
-ms-transition-timing-function: $easing;
|
150
|
+
transition-timing-function: $easing;
|
151
|
+
}
|
152
|
+
@mixin boxRotate($deg) {
|
153
|
+
-webkit-transform:rotate($deg);
|
154
|
+
-moz-transform: rotate($deg);
|
155
|
+
-ms-transform: rotate($deg);
|
156
|
+
-o-transform: rotate($deg);
|
157
|
+
transform: rotate($deg);
|
158
|
+
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.9914448613738104, M12=-0.13052619222005157,M21=0.13052619222005157, M22=0.9914448613738104, sizingMethod='auto expand');
|
159
|
+
zoom: 1;
|
160
|
+
}
|
161
|
+
@mixin transition($name, $duration, $timing, $iteration, $delay) {
|
162
|
+
-webkit-animation: $name $duration $timing $iteration $delay;
|
163
|
+
-moz-animation: $name $duration $timing $iteration $delay;
|
164
|
+
-o-animation: $name $duration $timing $iteration $delay;
|
165
|
+
-ms-animation: $name $duration $timing $iteration $delay;
|
166
|
+
animation: $name $duration $timing $iteration $delay;
|
167
|
+
}
|
168
|
+
|
169
|
+
@mixin borderbox{
|
170
|
+
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
|
171
|
+
-moz-box-sizing: border-box; /* Firefox, other Gecko */
|
172
|
+
box-sizing: border-box; /* Opera/IE 8+ */
|
173
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
((d) ->
|
2
|
+
js = undefined
|
3
|
+
id = "facebook-jssdk"
|
4
|
+
ref = d.getElementsByTagName("script")[0]
|
5
|
+
return if d.getElementById(id)
|
6
|
+
js = d.createElement("script")
|
7
|
+
js.id = id
|
8
|
+
js.async = true
|
9
|
+
js.src = "//connect.facebook.net/en_US/all.js"
|
10
|
+
ref.parentNode.insertBefore js, ref
|
11
|
+
) document
|
12
|
+
|
13
|
+
window.fbAsyncInit = ->
|
14
|
+
FB.init
|
15
|
+
appId : window.gon.global.facebook.app_id
|
16
|
+
channelUrl : window.location.protocol + '//' + window.location.hostname + '/channel.html'
|
17
|
+
status : true
|
18
|
+
xfbml : true
|
19
|
+
cookie: true
|
@@ -0,0 +1,68 @@
|
|
1
|
+
html, body, div, span, applet, object, iframe,
|
2
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
3
|
+
a, abbr, acronym, address, big, cite, code,
|
4
|
+
del, dfn, em, img, ins, kbd, q, s, samp,
|
5
|
+
small, strike, strong, sub, sup, tt, var,
|
6
|
+
b, u, i, center,
|
7
|
+
dl, dt, dd, ol, ul, li,
|
8
|
+
fieldset, form, label, legend,
|
9
|
+
table, caption, tbody, tfoot, thead, tr, th, td,
|
10
|
+
article, aside, canvas, details, embed,
|
11
|
+
figure, figcaption, footer, header, hgroup,
|
12
|
+
menu, nav, output, ruby, section, summary,
|
13
|
+
time, mark, audio, video {
|
14
|
+
margin: 0;
|
15
|
+
padding: 0;
|
16
|
+
border: 0;
|
17
|
+
font-size: 100%;
|
18
|
+
font: inherit;
|
19
|
+
vertical-align: baseline;
|
20
|
+
}
|
21
|
+
html{
|
22
|
+
-webkit-text-size-adjust: 100%;
|
23
|
+
-ms-text-size-adjust: 100%;
|
24
|
+
}
|
25
|
+
article, aside, details, figcaption, figure,
|
26
|
+
footer, header, hgroup, menu, nav, section
|
27
|
+
{
|
28
|
+
display: block;
|
29
|
+
}
|
30
|
+
body {
|
31
|
+
line-height: 1;
|
32
|
+
}
|
33
|
+
ol, ul {
|
34
|
+
list-style: none;
|
35
|
+
}
|
36
|
+
blockquote, q {
|
37
|
+
quotes: none;
|
38
|
+
}
|
39
|
+
blockquote:before, blockquote:after,
|
40
|
+
q:before, q:after {
|
41
|
+
content: '';
|
42
|
+
content: none;
|
43
|
+
}
|
44
|
+
table {
|
45
|
+
border-collapse: collapse;
|
46
|
+
border-spacing: 0;
|
47
|
+
}
|
48
|
+
:focus{
|
49
|
+
outline: none;
|
50
|
+
}
|
51
|
+
.clear{
|
52
|
+
clear: both;
|
53
|
+
}
|
54
|
+
.hidden{
|
55
|
+
display: none;
|
56
|
+
}
|
57
|
+
strong{
|
58
|
+
font-weight: bold;
|
59
|
+
}
|
60
|
+
input[type="submit"], input[type="button"], input[type="reset"], button{
|
61
|
+
-webkit-appearance: none;
|
62
|
+
}
|
63
|
+
/* padding works like normal semantic elements */
|
64
|
+
input[type="submit"], input[type="reset"], input[type="button"], button{
|
65
|
+
-webkit-box-sizing: content-box;
|
66
|
+
-moz-box-sizing: content-box;
|
67
|
+
box-sizing: content-box;
|
68
|
+
}
|
@@ -1,18 +1,19 @@
|
|
1
1
|
class TabController < ApplicationController
|
2
2
|
include Mobylette::RespondToMobileRequests
|
3
|
+
protect_from_forgery except: [:home]
|
4
|
+
after_action :allow_facebook_iframe
|
3
5
|
|
4
6
|
def home
|
7
|
+
@liked = false
|
5
8
|
if params[:signed_request]
|
6
9
|
set_fbid_session_if_authenticated_before_with_facebook
|
7
|
-
|
10
|
+
@show_fangate = !liked?
|
8
11
|
else
|
12
|
+
@show_fangate = false
|
9
13
|
redirect_to "http://www.facebook.com/#{ENV['FB_PAGE_NAME']}/app_#{ENV['FB_APP_ID']}" unless is_mobile_view?
|
10
14
|
end
|
11
15
|
end
|
12
16
|
|
13
|
-
def fangate
|
14
|
-
end
|
15
|
-
|
16
17
|
private
|
17
18
|
def liked?
|
18
19
|
if params[:signed_request]
|
@@ -45,4 +46,8 @@ class TabController < ApplicationController
|
|
45
46
|
encoded_sig, payload = signed_request.split('.')
|
46
47
|
data = base64_url_decode(payload)
|
47
48
|
end
|
49
|
+
|
50
|
+
def allow_facebook_iframe
|
51
|
+
response.headers['X-Frame-Options'] = "ALLOW-FROM https://www.facebook.com"
|
52
|
+
end
|
48
53
|
end
|
@@ -3,12 +3,13 @@
|
|
3
3
|
<head>
|
4
4
|
<meta charset="utf-8" />
|
5
5
|
<title><%%= page_title %></title>
|
6
|
-
<%%= stylesheet_link_tag
|
6
|
+
<%%= stylesheet_link_tag "application", media: "all" %>
|
7
7
|
<%%= include_gon %>
|
8
|
-
<%%= javascript_include_tag
|
8
|
+
<%%= javascript_include_tag "application" %>
|
9
9
|
<%%= csrf_meta_tags %>
|
10
10
|
</head>
|
11
11
|
<body class="<%%= body_class %>">
|
12
|
+
<div id="fb-root"></div>
|
12
13
|
<%%= render 'flashes' -%>
|
13
14
|
<%%= yield %>
|
14
15
|
</body>
|
data/wired.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.rdoc_options = ["--charset=UTF-8"]
|
24
24
|
s.extra_rdoc_files = %w[README.md LICENSE]
|
25
25
|
|
26
|
-
s.add_dependency 'rails', '
|
26
|
+
s.add_dependency 'rails', '4.0.0'
|
27
27
|
s.add_dependency 'bundler', '>= 1.1'
|
28
28
|
s.add_dependency 'hub', '~> 1.10.5'
|
29
|
-
end
|
29
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wired
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wirelab Creative
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,26 +16,26 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
@@ -63,6 +63,7 @@ extra_rdoc_files:
|
|
63
63
|
files:
|
64
64
|
- LICENSE
|
65
65
|
- README.md
|
66
|
+
- Rakefile
|
66
67
|
- bin/wired
|
67
68
|
- lib/wired/actions.rb
|
68
69
|
- lib/wired/app_builder.rb
|
@@ -73,11 +74,14 @@ files:
|
|
73
74
|
- templates/_flashes.html.erb
|
74
75
|
- templates/database.yml.erb
|
75
76
|
- templates/email_validator.rb
|
77
|
+
- templates/facebook/_variables.css.scss
|
76
78
|
- templates/facebook/channel.html
|
77
79
|
- templates/facebook/cookie.html.erb
|
80
|
+
- templates/facebook/cookie_fix.js.coffee
|
81
|
+
- templates/facebook/env
|
78
82
|
- templates/facebook/export_controller.rb
|
79
|
-
- templates/facebook/
|
80
|
-
- templates/facebook/
|
83
|
+
- templates/facebook/facebook.js.coffee
|
84
|
+
- templates/facebook/reset.css.scss
|
81
85
|
- templates/facebook/sessions_controller.rb
|
82
86
|
- templates/facebook/tab_controller.rb
|
83
87
|
- templates/layout.html.erb.erb
|
@@ -94,19 +98,18 @@ require_paths:
|
|
94
98
|
- lib
|
95
99
|
required_ruby_version: !ruby/object:Gem::Requirement
|
96
100
|
requirements:
|
97
|
-
- -
|
101
|
+
- - '>='
|
98
102
|
- !ruby/object:Gem::Version
|
99
103
|
version: '0'
|
100
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
105
|
requirements:
|
102
|
-
- -
|
106
|
+
- - '>='
|
103
107
|
- !ruby/object:Gem::Version
|
104
108
|
version: '0'
|
105
109
|
requirements: []
|
106
110
|
rubyforge_project:
|
107
|
-
rubygems_version: 2.0.
|
111
|
+
rubygems_version: 2.0.2
|
108
112
|
signing_key:
|
109
113
|
specification_version: 4
|
110
114
|
summary: Wirelab Generator
|
111
115
|
test_files: []
|
112
|
-
has_rdoc:
|
data/templates/facebook/powenv
DELETED