rosey 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +142 -0
- data/Rakefile +2 -0
- data/lib/rosey.rb +4 -0
- data/lib/rosey/config.rb +18 -0
- data/lib/rosey/tasks/all.rb +3 -0
- data/lib/rosey/tasks/assets.rb +13 -0
- data/lib/rosey/tasks/deployment.rb +56 -0
- data/lib/rosey/version.rb +3 -0
- data/rosey.gemspec +21 -0
- data/rosey.jpg +0 -0
- metadata +106 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Chris Kowalik
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,142 @@
|
|
1
|
+
# Rosey keeps your house clean!
|
2
|
+
|
3
|
+
Rosey is a robotic housekeeper for your HTML5 based apps.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'rosey'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install rosey
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
Add rosey to your `Rakefile` and set it up with your own configuration:
|
22
|
+
|
23
|
+
require 'rosey/tasks/all'
|
24
|
+
|
25
|
+
$GO = ENV['GO'] || "go"
|
26
|
+
$FOREMAN = ENV['FOREMAN'] || "foreman"
|
27
|
+
$PUBLIC_DIR ||= "public"
|
28
|
+
$COMPILED_ASSETS_DIR ||= "#{$PUBLIC_DIR}/assets"
|
29
|
+
$PRODUCTION_BRANCH ||= "production"
|
30
|
+
|
31
|
+
Now specify custom tasks you'd like to have:
|
32
|
+
|
33
|
+
desc "Starts application server."
|
34
|
+
task :server => :install do
|
35
|
+
sh "#{$FOREMAN} start"
|
36
|
+
end
|
37
|
+
|
38
|
+
desc "Rebuilds backend application."
|
39
|
+
task :build do
|
40
|
+
sh "#{$GO} build ."
|
41
|
+
end
|
42
|
+
|
43
|
+
desc "Runs all tests against backend."
|
44
|
+
task :test do
|
45
|
+
sh "#{$GO} test ./..."
|
46
|
+
end
|
47
|
+
|
48
|
+
# *snip*
|
49
|
+
|
50
|
+
Specify your deployment strategy tasks too. Here's an example of deploying
|
51
|
+
app to heroku.
|
52
|
+
|
53
|
+
namespace :deploy do
|
54
|
+
task :push do
|
55
|
+
sh "#{$GIT} push heroku #{$PRODUCTION_BRANCH}:master"
|
56
|
+
end
|
57
|
+
|
58
|
+
task :prepare => :default
|
59
|
+
end
|
60
|
+
|
61
|
+
Task `prepare` will be invoked just before creating new release,
|
62
|
+
and `push` will be invoked just afterword.
|
63
|
+
|
64
|
+
### Assets packaging
|
65
|
+
|
66
|
+
Rosey provides neat tasks for assets packaging and development. You
|
67
|
+
can compile assets with the following task:
|
68
|
+
|
69
|
+
$ rake assets:precompile
|
70
|
+
|
71
|
+
This command reads assets configuration from `config/assets.yml`
|
72
|
+
file, which is standard Jammit config file.
|
73
|
+
|
74
|
+
You can also specify `DEV` option to execute it in development mode:
|
75
|
+
|
76
|
+
$ rake assets:precompile DEV=1
|
77
|
+
|
78
|
+
This can be combined with ERb powered Jammit's configuration:
|
79
|
+
|
80
|
+
<% if ENV['DEV'] == '1' %>
|
81
|
+
compress_assets: off
|
82
|
+
embed_assets: off
|
83
|
+
gzip_assets: off
|
84
|
+
<% else %>
|
85
|
+
compress_assets: on
|
86
|
+
embed_assets: datauri
|
87
|
+
gzip_assets: true
|
88
|
+
<% end %>
|
89
|
+
|
90
|
+
# *snip*
|
91
|
+
|
92
|
+
To speed up development you can keep watching for assets changes. Add
|
93
|
+
following `Guardfile` to your project:
|
94
|
+
|
95
|
+
guard :livereload do
|
96
|
+
watch %r{public/.*$}
|
97
|
+
end
|
98
|
+
|
99
|
+
guard :shell do
|
100
|
+
watch %r{^((assets/(.+/)?.+\.(js|jst|css))|(config/assets.yml))$} do |m|
|
101
|
+
system 'rake assets:precompile DEV=1'
|
102
|
+
n "Assets recompiled (changed files: #{m.join(', ')})"
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
Now start guard with command:
|
107
|
+
|
108
|
+
$ rake assets:watch
|
109
|
+
|
110
|
+
### Deployment
|
111
|
+
|
112
|
+
To start working with deployment features, you must create a production
|
113
|
+
branch in your repo first:
|
114
|
+
|
115
|
+
$ git checkout -b production
|
116
|
+
|
117
|
+
Next, you must remove precompiled assets locations from your `.gitignore`
|
118
|
+
and create a version file:
|
119
|
+
|
120
|
+
$ echo 0 > VERSION
|
121
|
+
|
122
|
+
Now just commit and push those changes, and go back to master.
|
123
|
+
|
124
|
+
$ git add .gitignore VERSION
|
125
|
+
$ git commit -m "prepared production branch"
|
126
|
+
$ git push production master
|
127
|
+
|
128
|
+
From now on you can use deployment tasks provided by Rosey:
|
129
|
+
|
130
|
+
$ rake deploy
|
131
|
+
|
132
|
+
This task will build your app (or run tests), precompile assets,
|
133
|
+
commit changes to production branch and push them both to the
|
134
|
+
repository and to the server.
|
135
|
+
|
136
|
+
## Contributing
|
137
|
+
|
138
|
+
1. Fork it
|
139
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
140
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
141
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
142
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
data/lib/rosey.rb
ADDED
data/lib/rosey/config.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# This is Rosey's global configuration file.
|
2
|
+
|
3
|
+
# Git command.
|
4
|
+
$GIT = ENV['GIT'] ||"git"
|
5
|
+
# Jammit command.
|
6
|
+
$JAMMIT = ENV['JAMMIT'] || "jammit"
|
7
|
+
# Bundler's bundle command.
|
8
|
+
$BUNDLE = ENV['BUNDLE'] || "bundle"
|
9
|
+
# Guard command.
|
10
|
+
$GUARD = ENV['GUARD'] || "guard"
|
11
|
+
# Public files folder.
|
12
|
+
$PUBLIC_DIR = ENV['PUBLIC_DIR']
|
13
|
+
# Compiled assets will land here.
|
14
|
+
$COMPILED_ASSETS_DIR = ENV['COMPILED_ASSETS_DIR']
|
15
|
+
# Deployments will be committed to this branch.
|
16
|
+
$PRODUCTION_BRANCH = ENV['PRODUCTION_BRANCH']
|
17
|
+
# Is it development mode?
|
18
|
+
$DEV = ENV['DEV'] == 1
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Rosey's assets related tasks.
|
2
|
+
|
3
|
+
namespace :assets do
|
4
|
+
desc "Precompiles static assets."
|
5
|
+
task :precompile do
|
6
|
+
sh "#{$JAMMIT} -f -o #{$COMPILED_ASSETS_DIR}"
|
7
|
+
end
|
8
|
+
|
9
|
+
desc "Starts watching static assets directory for changes."
|
10
|
+
task :watch do
|
11
|
+
sh "#{$GUARD} start -i"
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# Rosey's deployment related tasks.
|
2
|
+
|
3
|
+
require 'colorize'
|
4
|
+
|
5
|
+
desc "Builds backend, compiles static assets and deploys the app."
|
6
|
+
task :deploy => "deploy:require_clean_tree" do
|
7
|
+
puts "# Merging changes to master...".cyan
|
8
|
+
Rake::Task["deploy:merge_master"].invoke
|
9
|
+
|
10
|
+
puts "\n# Building project and precompiling assets...".cyan
|
11
|
+
Rake::Task["deploy:prepare"].invoke
|
12
|
+
|
13
|
+
puts "\n# Committing changes...".cyan
|
14
|
+
Rake::Task["deploy:commit_release"].invoke
|
15
|
+
|
16
|
+
puts "\n# Release v#{$VERSION} ready, deploying...".cyan
|
17
|
+
Rake::Task["deploy:push"].invoke
|
18
|
+
|
19
|
+
puts "\n# Backing up...".cyan
|
20
|
+
Rake::Task["deploy:push_origin"].invoke
|
21
|
+
|
22
|
+
puts "\n# Cleaning up...".cyan
|
23
|
+
Rake::Task["deploy:cleanup"].invoke
|
24
|
+
end
|
25
|
+
|
26
|
+
namespace :deploy do
|
27
|
+
task :require_clean_tree do
|
28
|
+
system "#{$GIT} diff --quiet HEAD"
|
29
|
+
raise "Uncommited changes detected, commit or stash them before deploy!".red if $? != 0
|
30
|
+
end
|
31
|
+
|
32
|
+
task :merge_master do
|
33
|
+
sh "#{$GIT} reset HEAD ."
|
34
|
+
sh "#{$GIT} checkout -f production"
|
35
|
+
sh "#{$GIT} merge master -q --no-commit -s recursive -Xtheirs"
|
36
|
+
end
|
37
|
+
|
38
|
+
task :release_bump do
|
39
|
+
$VERSION = File.read('VERSION') rescue 0
|
40
|
+
$VERSION = $VERSION.to_i + 1
|
41
|
+
File.open('VERSION', 'w+') { |f| f.write($VERSION) }
|
42
|
+
end
|
43
|
+
|
44
|
+
task :commit_release => "deploy:release_bump" do
|
45
|
+
sh "#{$GIT} add VERSION #{$COMPILED_ASSETS_DIR}"
|
46
|
+
sh "#{$GIT} commit -qm 'Release v#{$VERSION}'"
|
47
|
+
end
|
48
|
+
|
49
|
+
task :push_origin do
|
50
|
+
sh "#{$GIT} push origin #{$PRODUCTION_BRANCH}"
|
51
|
+
end
|
52
|
+
|
53
|
+
task :cleanup do
|
54
|
+
sh "#{$GIT} checkout master"
|
55
|
+
end
|
56
|
+
end
|
data/rosey.gemspec
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/rosey/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Chris Kowalik"]
|
6
|
+
gem.email = ["chris@nu7hat.ch"]
|
7
|
+
gem.description = %q{Rosey helps you keep your house clean.}
|
8
|
+
gem.summary = %q{Rosey is a robotic houskeeper for your HTML5 apps}
|
9
|
+
gem.homepage = "https://github.com/nu7hatch/rosey"
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = "rosey"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = Rosey::VERSION
|
17
|
+
|
18
|
+
gem.add_dependency "colorize"
|
19
|
+
gem.add_dependency "jammit"
|
20
|
+
gem.add_dependency "json"
|
21
|
+
end
|
data/rosey.jpg
ADDED
Binary file
|
metadata
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rosey
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Chris Kowalik
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-08-23 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: colorize
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: jammit
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: json
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
description: Rosey helps you keep your house clean.
|
63
|
+
email:
|
64
|
+
- chris@nu7hat.ch
|
65
|
+
executables: []
|
66
|
+
extensions: []
|
67
|
+
extra_rdoc_files: []
|
68
|
+
files:
|
69
|
+
- .gitignore
|
70
|
+
- Gemfile
|
71
|
+
- LICENSE
|
72
|
+
- README.md
|
73
|
+
- Rakefile
|
74
|
+
- lib/rosey.rb
|
75
|
+
- lib/rosey/config.rb
|
76
|
+
- lib/rosey/tasks/all.rb
|
77
|
+
- lib/rosey/tasks/assets.rb
|
78
|
+
- lib/rosey/tasks/deployment.rb
|
79
|
+
- lib/rosey/version.rb
|
80
|
+
- rosey.gemspec
|
81
|
+
- rosey.jpg
|
82
|
+
homepage: https://github.com/nu7hatch/rosey
|
83
|
+
licenses: []
|
84
|
+
post_install_message:
|
85
|
+
rdoc_options: []
|
86
|
+
require_paths:
|
87
|
+
- lib
|
88
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ! '>='
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
requirements: []
|
101
|
+
rubyforge_project:
|
102
|
+
rubygems_version: 1.8.24
|
103
|
+
signing_key:
|
104
|
+
specification_version: 3
|
105
|
+
summary: Rosey is a robotic houskeeper for your HTML5 apps
|
106
|
+
test_files: []
|