citizen-scripts 1.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/.document +5 -0
- data/.rspec +2 -0
- data/.ruby-version +1 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +117 -0
- data/LICENSE.txt +20 -0
- data/README.md +108 -0
- data/Rakefile +53 -0
- data/VERSION +1 -0
- data/bin/citizen +26 -0
- data/citizen.yml +5 -0
- data/citizen_code_scripts.gemspec +90 -0
- data/lib/citizen_code_scripts/base.rb +95 -0
- data/lib/citizen_code_scripts/begin.rb +195 -0
- data/lib/citizen_code_scripts/colorize.rb +39 -0
- data/lib/citizen_code_scripts/doctor.rb +179 -0
- data/lib/citizen_code_scripts/help.rb +53 -0
- data/lib/citizen_code_scripts/heroku_doctor.rb +58 -0
- data/lib/citizen_code_scripts/kill_db_sessions.rb +22 -0
- data/lib/citizen_code_scripts/levenstein.rb +40 -0
- data/lib/citizen_code_scripts/pushit.rb +23 -0
- data/lib/citizen_code_scripts/rspec.rb +19 -0
- data/lib/citizen_code_scripts/test.rb +17 -0
- data/lib/citizen_code_scripts/todayi.rb +29 -0
- data/lib/citizen_code_scripts/update.rb +63 -0
- data/lib/citizen_code_scripts.rb +7 -0
- data/spec/passing_spec.rb +5 -0
- data/spec/spec_helper.rb +62 -0
- metadata +190 -0
@@ -0,0 +1,63 @@
|
|
1
|
+
class CitizenCodeScripts::Update < CitizenCodeScripts::Base
|
2
|
+
def self.help
|
3
|
+
<<-EOF
|
4
|
+
citizen update
|
5
|
+
|
6
|
+
This script is a way to update your development environment automatically.
|
7
|
+
EOF
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.description
|
11
|
+
"Updates your dev environment automatically"
|
12
|
+
end
|
13
|
+
|
14
|
+
def run
|
15
|
+
pull_git
|
16
|
+
install_dependencies
|
17
|
+
update_db
|
18
|
+
remove_old_logs
|
19
|
+
restart_rails
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def pull_git
|
25
|
+
step "Pulling from git" do
|
26
|
+
system! "git pull --rebase"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def install_dependencies
|
31
|
+
step "Installing dependencies" do
|
32
|
+
system! 'gem install bundler --conservative'
|
33
|
+
system('bundle check') || system!('bundle install')
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def update_db
|
38
|
+
step "Updating database" do
|
39
|
+
system! 'rake db:migrate'
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def remove_old_logs
|
44
|
+
step "Removing old logs and tempfiles" do
|
45
|
+
system! 'rake log:clear tmp:clear'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def restart_rails
|
50
|
+
step "Attempting to restart Rails" do
|
51
|
+
output = `bin/rails restart`
|
52
|
+
|
53
|
+
if $?.exitstatus > 0
|
54
|
+
puts colorize(
|
55
|
+
:light_red,
|
56
|
+
"skipping restart, not supported in this version of Rails (needs >= 5)"
|
57
|
+
)
|
58
|
+
else
|
59
|
+
puts output
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
RSpec.configure do |config|
|
2
|
+
# rspec-expectations config goes here. You can use an alternate
|
3
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
4
|
+
# assertions if you prefer.
|
5
|
+
config.expect_with :rspec do |expectations|
|
6
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
7
|
+
# and `failure_message` of custom matchers include text for helper methods
|
8
|
+
# defined using `chain`, e.g.:
|
9
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
10
|
+
# # => "be bigger than 2 and smaller than 4"
|
11
|
+
# ...rather than:
|
12
|
+
# # => "be bigger than 2"
|
13
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
14
|
+
end
|
15
|
+
|
16
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
17
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
18
|
+
config.mock_with :rspec do |mocks|
|
19
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
20
|
+
# a real object. This is generally recommended, and will default to
|
21
|
+
# `true` in RSpec 4.
|
22
|
+
mocks.verify_partial_doubles = true
|
23
|
+
end
|
24
|
+
|
25
|
+
# These two settings work together to allow you to limit a spec run
|
26
|
+
# to individual examples or groups you care about by tagging them with
|
27
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
28
|
+
# get run.
|
29
|
+
config.filter_run :focus
|
30
|
+
config.run_all_when_everything_filtered = true
|
31
|
+
|
32
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
33
|
+
# be too noisy due to issues in dependencies.
|
34
|
+
config.warnings = true
|
35
|
+
|
36
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
37
|
+
# file, and it's useful to allow more verbose output when running an
|
38
|
+
# individual spec file.
|
39
|
+
if config.files_to_run.one?
|
40
|
+
# Use the documentation formatter for detailed output,
|
41
|
+
# unless a formatter has already been configured
|
42
|
+
# (e.g. via a command-line flag).
|
43
|
+
config.default_formatter = 'doc'
|
44
|
+
end
|
45
|
+
|
46
|
+
# Print the 10 slowest examples and example groups at the
|
47
|
+
# end of the spec run, to help surface which specs are running
|
48
|
+
# particularly slow.
|
49
|
+
config.profile_examples = 10
|
50
|
+
|
51
|
+
# Run specs in random order to surface order dependencies. If you find an
|
52
|
+
# order dependency and want to debug it, you can fix the order by providing
|
53
|
+
# the seed, which is printed after each run.
|
54
|
+
# --seed 1234
|
55
|
+
config.order = :random
|
56
|
+
|
57
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
58
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
59
|
+
# test failures related to randomization by passing the same `--seed` value
|
60
|
+
# as the one that triggered the failure.
|
61
|
+
Kernel.srand config.seed
|
62
|
+
end
|
metadata
ADDED
@@ -0,0 +1,190 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: citizen-scripts
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Glenn Jahnke
|
8
|
+
- Erik Hanson
|
9
|
+
- Bion Johnson
|
10
|
+
- David Balatero
|
11
|
+
autorequire:
|
12
|
+
bindir: bin
|
13
|
+
cert_chain: []
|
14
|
+
date: 2016-11-10 00:00:00.000000000 Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: bundler
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - "~>"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '1.0'
|
23
|
+
type: :development
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: jeweler
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - "~>"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '2'
|
37
|
+
type: :development
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - "~>"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '2'
|
44
|
+
- !ruby/object:Gem::Dependency
|
45
|
+
name: pry
|
46
|
+
requirement: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0'
|
51
|
+
type: :development
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: pry-stack_explorer
|
60
|
+
requirement: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
type: :development
|
66
|
+
prerelease: false
|
67
|
+
version_requirements: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
- !ruby/object:Gem::Dependency
|
73
|
+
name: rdoc
|
74
|
+
requirement: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - "~>"
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '3.12'
|
79
|
+
type: :development
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - "~>"
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '3.12'
|
86
|
+
- !ruby/object:Gem::Dependency
|
87
|
+
name: rspec
|
88
|
+
requirement: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
type: :development
|
94
|
+
prerelease: false
|
95
|
+
version_requirements: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
- !ruby/object:Gem::Dependency
|
101
|
+
name: shoulda
|
102
|
+
requirement: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
type: :development
|
108
|
+
prerelease: false
|
109
|
+
version_requirements: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
114
|
+
- !ruby/object:Gem::Dependency
|
115
|
+
name: simplecov
|
116
|
+
requirement: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
121
|
+
type: :development
|
122
|
+
prerelease: false
|
123
|
+
version_requirements: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - ">="
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '0'
|
128
|
+
description: Citizen Code tools for easy building, testing, and deploying RoR/Android/iOS
|
129
|
+
apps into teh cloudz
|
130
|
+
email: opensource@citizencode.io
|
131
|
+
executables:
|
132
|
+
- citizen
|
133
|
+
extensions: []
|
134
|
+
extra_rdoc_files:
|
135
|
+
- LICENSE.txt
|
136
|
+
- README.md
|
137
|
+
files:
|
138
|
+
- ".document"
|
139
|
+
- ".rspec"
|
140
|
+
- ".ruby-version"
|
141
|
+
- Gemfile
|
142
|
+
- Gemfile.lock
|
143
|
+
- LICENSE.txt
|
144
|
+
- README.md
|
145
|
+
- Rakefile
|
146
|
+
- VERSION
|
147
|
+
- bin/citizen
|
148
|
+
- citizen.yml
|
149
|
+
- citizen_code_scripts.gemspec
|
150
|
+
- lib/citizen_code_scripts.rb
|
151
|
+
- lib/citizen_code_scripts/base.rb
|
152
|
+
- lib/citizen_code_scripts/begin.rb
|
153
|
+
- lib/citizen_code_scripts/colorize.rb
|
154
|
+
- lib/citizen_code_scripts/doctor.rb
|
155
|
+
- lib/citizen_code_scripts/help.rb
|
156
|
+
- lib/citizen_code_scripts/heroku_doctor.rb
|
157
|
+
- lib/citizen_code_scripts/kill_db_sessions.rb
|
158
|
+
- lib/citizen_code_scripts/levenstein.rb
|
159
|
+
- lib/citizen_code_scripts/pushit.rb
|
160
|
+
- lib/citizen_code_scripts/rspec.rb
|
161
|
+
- lib/citizen_code_scripts/test.rb
|
162
|
+
- lib/citizen_code_scripts/todayi.rb
|
163
|
+
- lib/citizen_code_scripts/update.rb
|
164
|
+
- spec/passing_spec.rb
|
165
|
+
- spec/spec_helper.rb
|
166
|
+
homepage: http://github.com/citizencode/citizen_code_scripts
|
167
|
+
licenses:
|
168
|
+
- MIT
|
169
|
+
metadata: {}
|
170
|
+
post_install_message:
|
171
|
+
rdoc_options: []
|
172
|
+
require_paths:
|
173
|
+
- lib
|
174
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
175
|
+
requirements:
|
176
|
+
- - ">="
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
version: '0'
|
179
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
180
|
+
requirements:
|
181
|
+
- - ">="
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
version: '0'
|
184
|
+
requirements: []
|
185
|
+
rubyforge_project:
|
186
|
+
rubygems_version: 2.5.1
|
187
|
+
signing_key:
|
188
|
+
specification_version: 4
|
189
|
+
summary: Citizen Code command-line scripts for easy testing and deployment
|
190
|
+
test_files: []
|