social_pilot 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Rakefile +34 -0
- data/lib/social_pilot/account.rb +12 -0
- data/lib/social_pilot/version.rb +3 -0
- data/lib/social_pilot.rb +53 -0
- data/lib/tasks/social_pilot_tasks.rake +4 -0
- data/test/dummy/Gemfile +50 -0
- data/test/dummy/Gemfile.lock +186 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +16 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +9 -0
- data/test/dummy/bin/rake +9 -0
- data/test/dummy/bin/setup +29 -0
- data/test/dummy/bin/spring +17 -0
- data/test/dummy/config/application.rb +26 -0
- data/test/dummy/config/boot.rb +3 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +41 -0
- data/test/dummy/config/environments/production.rb +79 -0
- data/test/dummy/config/environments/test.rb +42 -0
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/uk_vehicle_data.rb +1 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +56 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/seeds.rb +7 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/public/robots.txt +5 -0
- data/test/dummy/test/test_helper.rb +10 -0
- data/test/test_helper.rb +20 -0
- data/test/ukvehicledata_test.rb +7 -0
- metadata +149 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4a86b06e0026b298cb178a65faa92011db97d5b6
|
4
|
+
data.tar.gz: b063d4b921ead1cb9bc821007ed21308c122f945
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a45efdb7789d5f309bf9670d3def189cb0b23024a0d564ff0d87e88dd53aef9dc755e0a02eb4e2ce82e7709a5052235d64607a678c1603312e3bdb083e564249
|
7
|
+
data.tar.gz: 84cad58aec2b7093407219b1f2c683acfc60accdb4f980cda78052402634d8bb6717d9814fe2708a340eaab09df5efe5b20d5af254f079cea0e7777138eece3c
|
data/Rakefile
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'Ukvehicledata'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
Bundler::GemHelper.install_tasks
|
23
|
+
|
24
|
+
require 'rake/testtask'
|
25
|
+
|
26
|
+
Rake::TestTask.new(:test) do |t|
|
27
|
+
t.libs << 'lib'
|
28
|
+
t.libs << 'test'
|
29
|
+
t.pattern = 'test/**/*_test.rb'
|
30
|
+
t.verbose = false
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
task default: :test
|
data/lib/social_pilot.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'rest-client'
|
2
|
+
|
3
|
+
require 'social_pilot/account'
|
4
|
+
|
5
|
+
|
6
|
+
module SocialPilot
|
7
|
+
API_BASE = "https://panel.socialpilot.co/oauth/"
|
8
|
+
|
9
|
+
class SocialPilotError < StandardError
|
10
|
+
end
|
11
|
+
|
12
|
+
class AuthenticationError < SocialPilotError; end
|
13
|
+
class ConfigurationError < SocialPilotError; end
|
14
|
+
|
15
|
+
class << self
|
16
|
+
|
17
|
+
attr_writer :access_token
|
18
|
+
|
19
|
+
def request method, resource, params={}
|
20
|
+
vd_access_token = params[:access_token] || SocialPilot.access_token
|
21
|
+
|
22
|
+
params.merge!({access_token: vd_access_token})
|
23
|
+
|
24
|
+
defined? vd_access_token or raise(
|
25
|
+
ConfigurationError, "SocialPilot access token not configured"
|
26
|
+
)
|
27
|
+
defined? method or raise(
|
28
|
+
ArgumentError, "Request method has not been specified"
|
29
|
+
)
|
30
|
+
defined? resource or raise(
|
31
|
+
ArgumentError, "Request resource has not been specified"
|
32
|
+
)
|
33
|
+
|
34
|
+
if method == :get
|
35
|
+
headers = { :accept => :json, content_type: :json }.merge({params: params})
|
36
|
+
payload = nil
|
37
|
+
else
|
38
|
+
headers = { :accept => :json, content_type: :json }
|
39
|
+
payload = params
|
40
|
+
end
|
41
|
+
|
42
|
+
RestClient::Request.new({
|
43
|
+
method: method,
|
44
|
+
url: API_BASE + resource,
|
45
|
+
payload: payload ? payload.to_json : nil,
|
46
|
+
headers: headers
|
47
|
+
}).execute do |response, request, result|
|
48
|
+
str_response = response.to_str
|
49
|
+
str_response.blank? ? '' : JSON.parse(str_response)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
data/test/dummy/Gemfile
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
source 'http://rubygems.org'
|
2
|
+
|
3
|
+
|
4
|
+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
5
|
+
gem 'rails', '4.2.7'
|
6
|
+
# Use sqlite3 as the database for Active Record
|
7
|
+
gem 'sqlite3'
|
8
|
+
# Use SCSS for stylesheets
|
9
|
+
gem 'sass-rails', '~> 5.0'
|
10
|
+
# Use Uglifier as compressor for JavaScript assets
|
11
|
+
gem 'uglifier', '>= 1.3.0'
|
12
|
+
# Use CoffeeScript for .coffee assets and views
|
13
|
+
gem 'coffee-rails', '~> 4.1.0'
|
14
|
+
# See https://github.com/rails/execjs#readme for more supported runtimes
|
15
|
+
# gem 'therubyracer', platforms: :ruby
|
16
|
+
|
17
|
+
# Use jquery as the JavaScript library
|
18
|
+
gem 'jquery-rails'
|
19
|
+
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
|
20
|
+
gem 'turbolinks'
|
21
|
+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
|
22
|
+
gem 'jbuilder', '~> 2.0'
|
23
|
+
# bundle exec rake doc:rails generates the API under doc/api.
|
24
|
+
gem 'sdoc', '~> 0.4.0', group: :doc
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
# Use ActiveModel has_secure_password
|
30
|
+
# gem 'bcrypt', '~> 3.1.7'
|
31
|
+
|
32
|
+
# Use Unicorn as the app server
|
33
|
+
# gem 'unicorn'
|
34
|
+
|
35
|
+
# Use Capistrano for deployment
|
36
|
+
# gem 'capistrano-rails', group: :development
|
37
|
+
|
38
|
+
group :development, :test do
|
39
|
+
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
40
|
+
gem 'byebug'
|
41
|
+
end
|
42
|
+
|
43
|
+
group :development do
|
44
|
+
# Access an IRB console on exception pages or by using <%= console %> in views
|
45
|
+
gem 'web-console', '~> 2.0'
|
46
|
+
|
47
|
+
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
|
48
|
+
gem 'spring'
|
49
|
+
end
|
50
|
+
|
@@ -0,0 +1,186 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
actionmailer (4.2.7)
|
5
|
+
actionpack (= 4.2.7)
|
6
|
+
actionview (= 4.2.7)
|
7
|
+
activejob (= 4.2.7)
|
8
|
+
mail (~> 2.5, >= 2.5.4)
|
9
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
10
|
+
actionpack (4.2.7)
|
11
|
+
actionview (= 4.2.7)
|
12
|
+
activesupport (= 4.2.7)
|
13
|
+
rack (~> 1.6)
|
14
|
+
rack-test (~> 0.6.2)
|
15
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
16
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
17
|
+
actionview (4.2.7)
|
18
|
+
activesupport (= 4.2.7)
|
19
|
+
builder (~> 3.1)
|
20
|
+
erubis (~> 2.7.0)
|
21
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
22
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
23
|
+
activejob (4.2.7)
|
24
|
+
activesupport (= 4.2.7)
|
25
|
+
globalid (>= 0.3.0)
|
26
|
+
activemodel (4.2.7)
|
27
|
+
activesupport (= 4.2.7)
|
28
|
+
builder (~> 3.1)
|
29
|
+
activerecord (4.2.7)
|
30
|
+
activemodel (= 4.2.7)
|
31
|
+
activesupport (= 4.2.7)
|
32
|
+
arel (~> 6.0)
|
33
|
+
activesupport (4.2.7)
|
34
|
+
i18n (~> 0.7)
|
35
|
+
json (~> 1.7, >= 1.7.7)
|
36
|
+
minitest (~> 5.1)
|
37
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
38
|
+
tzinfo (~> 1.1)
|
39
|
+
arel (6.0.4)
|
40
|
+
binding_of_caller (0.8.0)
|
41
|
+
debug_inspector (>= 0.0.1)
|
42
|
+
builder (3.2.3)
|
43
|
+
byebug (10.0.2)
|
44
|
+
coffee-rails (4.1.1)
|
45
|
+
coffee-script (>= 2.2.0)
|
46
|
+
railties (>= 4.0.0, < 5.1.x)
|
47
|
+
coffee-script (2.4.1)
|
48
|
+
coffee-script-source
|
49
|
+
execjs
|
50
|
+
coffee-script-source (1.12.2)
|
51
|
+
concurrent-ruby (1.0.5)
|
52
|
+
crass (1.0.4)
|
53
|
+
debug_inspector (0.0.3)
|
54
|
+
domain_name (0.5.20180417)
|
55
|
+
unf (>= 0.0.5, < 1.0.0)
|
56
|
+
erubis (2.7.0)
|
57
|
+
execjs (2.7.0)
|
58
|
+
ffi (1.9.23)
|
59
|
+
globalid (0.4.1)
|
60
|
+
activesupport (>= 4.2.0)
|
61
|
+
http-cookie (1.0.3)
|
62
|
+
domain_name (~> 0.5)
|
63
|
+
i18n (0.9.5)
|
64
|
+
concurrent-ruby (~> 1.0)
|
65
|
+
jbuilder (2.7.0)
|
66
|
+
activesupport (>= 4.2.0)
|
67
|
+
multi_json (>= 1.2)
|
68
|
+
jquery-rails (4.3.3)
|
69
|
+
rails-dom-testing (>= 1, < 3)
|
70
|
+
railties (>= 4.2.0)
|
71
|
+
thor (>= 0.14, < 2.0)
|
72
|
+
json (1.8.6)
|
73
|
+
loofah (2.2.2)
|
74
|
+
crass (~> 1.0.2)
|
75
|
+
nokogiri (>= 1.5.9)
|
76
|
+
mail (2.7.0)
|
77
|
+
mini_mime (>= 0.1.1)
|
78
|
+
mime-types (3.1)
|
79
|
+
mime-types-data (~> 3.2015)
|
80
|
+
mime-types-data (3.2016.0521)
|
81
|
+
mini_mime (1.0.0)
|
82
|
+
mini_portile2 (2.3.0)
|
83
|
+
minitest (5.11.3)
|
84
|
+
multi_json (1.13.1)
|
85
|
+
netrc (0.11.0)
|
86
|
+
nokogiri (1.8.2)
|
87
|
+
mini_portile2 (~> 2.3.0)
|
88
|
+
rack (1.6.10)
|
89
|
+
rack-test (0.6.3)
|
90
|
+
rack (>= 1.0)
|
91
|
+
rails (4.2.7)
|
92
|
+
actionmailer (= 4.2.7)
|
93
|
+
actionpack (= 4.2.7)
|
94
|
+
actionview (= 4.2.7)
|
95
|
+
activejob (= 4.2.7)
|
96
|
+
activemodel (= 4.2.7)
|
97
|
+
activerecord (= 4.2.7)
|
98
|
+
activesupport (= 4.2.7)
|
99
|
+
bundler (>= 1.3.0, < 2.0)
|
100
|
+
railties (= 4.2.7)
|
101
|
+
sprockets-rails
|
102
|
+
rails-deprecated_sanitizer (1.0.3)
|
103
|
+
activesupport (>= 4.2.0.alpha)
|
104
|
+
rails-dom-testing (1.0.9)
|
105
|
+
activesupport (>= 4.2.0, < 5.0)
|
106
|
+
nokogiri (~> 1.6)
|
107
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
108
|
+
rails-html-sanitizer (1.0.4)
|
109
|
+
loofah (~> 2.2, >= 2.2.2)
|
110
|
+
railties (4.2.7)
|
111
|
+
actionpack (= 4.2.7)
|
112
|
+
activesupport (= 4.2.7)
|
113
|
+
rake (>= 0.8.7)
|
114
|
+
thor (>= 0.18.1, < 2.0)
|
115
|
+
rake (12.3.1)
|
116
|
+
rb-fsevent (0.10.3)
|
117
|
+
rb-inotify (0.9.10)
|
118
|
+
ffi (>= 0.5.0, < 2)
|
119
|
+
rdoc (4.3.0)
|
120
|
+
rest-client (2.0.2)
|
121
|
+
http-cookie (>= 1.0.2, < 2.0)
|
122
|
+
mime-types (>= 1.16, < 4.0)
|
123
|
+
netrc (~> 0.8)
|
124
|
+
sass (3.5.6)
|
125
|
+
sass-listen (~> 4.0.0)
|
126
|
+
sass-listen (4.0.0)
|
127
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
128
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
129
|
+
sass-rails (5.0.7)
|
130
|
+
railties (>= 4.0.0, < 6)
|
131
|
+
sass (~> 3.1)
|
132
|
+
sprockets (>= 2.8, < 4.0)
|
133
|
+
sprockets-rails (>= 2.0, < 4.0)
|
134
|
+
tilt (>= 1.1, < 3)
|
135
|
+
sdoc (0.4.2)
|
136
|
+
json (~> 1.7, >= 1.7.7)
|
137
|
+
rdoc (~> 4.0)
|
138
|
+
spring (2.0.2)
|
139
|
+
activesupport (>= 4.2)
|
140
|
+
sprockets (3.7.1)
|
141
|
+
concurrent-ruby (~> 1.0)
|
142
|
+
rack (> 1, < 3)
|
143
|
+
sprockets-rails (3.2.1)
|
144
|
+
actionpack (>= 4.0)
|
145
|
+
activesupport (>= 4.0)
|
146
|
+
sprockets (>= 3.0.0)
|
147
|
+
sqlite3 (1.3.13)
|
148
|
+
thor (0.20.0)
|
149
|
+
thread_safe (0.3.6)
|
150
|
+
tilt (2.0.8)
|
151
|
+
turbolinks (5.1.1)
|
152
|
+
turbolinks-source (~> 5.1)
|
153
|
+
turbolinks-source (5.1.0)
|
154
|
+
tzinfo (1.2.5)
|
155
|
+
thread_safe (~> 0.1)
|
156
|
+
uglifier (4.1.10)
|
157
|
+
execjs (>= 0.3.0, < 3)
|
158
|
+
unf (0.1.4)
|
159
|
+
unf_ext
|
160
|
+
unf_ext (0.0.7.5)
|
161
|
+
web-console (2.3.0)
|
162
|
+
activemodel (>= 4.0)
|
163
|
+
binding_of_caller (>= 0.7.2)
|
164
|
+
railties (>= 4.0)
|
165
|
+
sprockets-rails (>= 2.0, < 4.0)
|
166
|
+
|
167
|
+
PLATFORMS
|
168
|
+
ruby
|
169
|
+
|
170
|
+
DEPENDENCIES
|
171
|
+
byebug
|
172
|
+
coffee-rails (~> 4.1.0)
|
173
|
+
jbuilder (~> 2.0)
|
174
|
+
jquery-rails
|
175
|
+
rails (= 4.2.7)
|
176
|
+
rest-client
|
177
|
+
sass-rails (~> 5.0)
|
178
|
+
sdoc (~> 0.4.0)
|
179
|
+
spring
|
180
|
+
sqlite3
|
181
|
+
turbolinks
|
182
|
+
uglifier (>= 1.3.0)
|
183
|
+
web-console (~> 2.0)
|
184
|
+
|
185
|
+
BUNDLED WITH
|
186
|
+
1.14.6
|
@@ -0,0 +1,28 @@
|
|
1
|
+
== README
|
2
|
+
|
3
|
+
This README would normally document whatever steps are necessary to get the
|
4
|
+
application up and running.
|
5
|
+
|
6
|
+
Things you may want to cover:
|
7
|
+
|
8
|
+
* Ruby version
|
9
|
+
|
10
|
+
* System dependencies
|
11
|
+
|
12
|
+
* Configuration
|
13
|
+
|
14
|
+
* Database creation
|
15
|
+
|
16
|
+
* Database initialization
|
17
|
+
|
18
|
+
* How to run the test suite
|
19
|
+
|
20
|
+
* Services (job queues, cache servers, search engines, etc.)
|
21
|
+
|
22
|
+
* Deployment instructions
|
23
|
+
|
24
|
+
* ...
|
25
|
+
|
26
|
+
|
27
|
+
Please feel free to use a different markup language if you do not plan to run
|
28
|
+
<tt>rake doc:app</tt>.
|
data/test/dummy/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//= require turbolinks
|
16
|
+
//= require_tree .
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
+
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
+
* file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
6
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
begin
|
3
|
+
load File.expand_path('../spring', __FILE__)
|
4
|
+
rescue LoadError => e
|
5
|
+
raise unless e.message.include?('spring')
|
6
|
+
end
|
7
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
8
|
+
require_relative '../config/boot'
|
9
|
+
require 'rails/commands'
|
data/test/dummy/bin/rake
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
# path to your application root.
|
5
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
6
|
+
|
7
|
+
Dir.chdir APP_ROOT do
|
8
|
+
# This script is a starting point to setup your application.
|
9
|
+
# Add necessary setup steps to this file:
|
10
|
+
|
11
|
+
puts "== Installing dependencies =="
|
12
|
+
system "gem install bundler --conservative"
|
13
|
+
system "bundle check || bundle install"
|
14
|
+
|
15
|
+
# puts "\n== Copying sample files =="
|
16
|
+
# unless File.exist?("config/database.yml")
|
17
|
+
# system "cp config/database.yml.sample config/database.yml"
|
18
|
+
# end
|
19
|
+
|
20
|
+
puts "\n== Preparing database =="
|
21
|
+
system "bin/rake db:setup"
|
22
|
+
|
23
|
+
puts "\n== Removing old logs and tempfiles =="
|
24
|
+
system "rm -f log/*"
|
25
|
+
system "rm -rf tmp/cache"
|
26
|
+
|
27
|
+
puts "\n== Restarting application server =="
|
28
|
+
system "touch tmp/restart.txt"
|
29
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# This file loads spring without using Bundler, in order to be fast.
|
4
|
+
# It gets overwritten when you run the `spring binstub` command.
|
5
|
+
|
6
|
+
unless defined?(Spring)
|
7
|
+
require 'rubygems'
|
8
|
+
require 'bundler'
|
9
|
+
|
10
|
+
lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
|
11
|
+
spring = lockfile.specs.detect { |spec| spec.name == "spring" }
|
12
|
+
if spring
|
13
|
+
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
|
14
|
+
gem 'spring', spring.version
|
15
|
+
require 'spring/binstub'
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
# Require the gems listed in Gemfile, including any gems
|
6
|
+
# you've limited to :test, :development, or :production.
|
7
|
+
Bundler.require(*Rails.groups)
|
8
|
+
|
9
|
+
module Dummy
|
10
|
+
class Application < Rails::Application
|
11
|
+
# Settings in config/environments/* take precedence over those specified here.
|
12
|
+
# Application configuration should go into files in config/initializers
|
13
|
+
# -- all .rb files in that directory are automatically loaded.
|
14
|
+
|
15
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
16
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
17
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
18
|
+
|
19
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
20
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
21
|
+
# config.i18n.default_locale = :de
|
22
|
+
|
23
|
+
# Do not swallow errors in after_commit/after_rollback callbacks.
|
24
|
+
config.active_record.raise_in_transactional_callbacks = true
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3
|
3
|
+
#
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
+
# gem 'sqlite3'
|
6
|
+
#
|
7
|
+
default: &default
|
8
|
+
adapter: sqlite3
|
9
|
+
pool: 5
|
10
|
+
timeout: 5000
|
11
|
+
|
12
|
+
development:
|
13
|
+
<<: *default
|
14
|
+
database: db/development.sqlite3
|
15
|
+
|
16
|
+
# Warning: The database defined as "test" will be erased and
|
17
|
+
# re-generated from your development database when you run "rake".
|
18
|
+
# Do not set this db to the same as development or production.
|
19
|
+
test:
|
20
|
+
<<: *default
|
21
|
+
database: db/test.sqlite3
|
22
|
+
|
23
|
+
production:
|
24
|
+
<<: *default
|
25
|
+
database: db/production.sqlite3
|
@@ -0,0 +1,41 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
|
+
|
12
|
+
# Show full error reports and disable caching.
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Don't care if the mailer can't send.
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
18
|
+
|
19
|
+
# Print deprecation notices to the Rails logger.
|
20
|
+
config.active_support.deprecation = :log
|
21
|
+
|
22
|
+
# Raise an error on page load if there are pending migrations.
|
23
|
+
config.active_record.migration_error = :page_load
|
24
|
+
|
25
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
26
|
+
# This option may cause significant delays in view rendering with a large
|
27
|
+
# number of complex assets.
|
28
|
+
config.assets.debug = true
|
29
|
+
|
30
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
31
|
+
# yet still be able to expire them through the digest params.
|
32
|
+
config.assets.digest = true
|
33
|
+
|
34
|
+
# Adds additional error checking when serving assets at runtime.
|
35
|
+
# Checks for improperly declared sprockets dependencies.
|
36
|
+
# Raises helpful error messages.
|
37
|
+
config.assets.raise_runtime_errors = true
|
38
|
+
|
39
|
+
# Raises error for missing translations
|
40
|
+
# config.action_view.raise_on_missing_translations = true
|
41
|
+
end
|