jumpup 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 64c2f1bcf7710ae23e0bed83fdee467ec674d947
4
+ data.tar.gz: 35643924db0b55a790c218a88d3e44bb41e2a137
5
+ SHA512:
6
+ metadata.gz: e21c85ecbc83aae1c0f1302f102e0b5d94bffbbba29dfe627299a7d3ca7e960aa0cb535362d2b09a0900720825a820726232b7d9d12e0b7b1f6223e01f4134e7
7
+ data.tar.gz: 3edfb5b1b58a2d2a6cc38ec9e43f667582ffcea51f861e8fe5094308143527075106e40c9037dfa4ad5ba96279bea48817d99d5dd901d5026ddaae2b69348eba
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/CHANGELOG.md ADDED
@@ -0,0 +1,28 @@
1
+ # Changelog
2
+
3
+ ## 0.0.1 (August 06, 2013)
4
+
5
+ ### features
6
+
7
+ - Changed integration to a gem named Jumpup
8
+
9
+ ### improvements
10
+
11
+ ### bug fixes
12
+
13
+ ## Previous
14
+
15
+ The changelog began with version 0.0.1 so any changes prior to that
16
+ can be seen by reading old git commit messages or with the original version of [integration](https://github.com/tapajos/integration) release notes below.
17
+
18
+ ### Release Notes
19
+
20
+ * Version 0.3.0 - Remove old svn support. Add support for Simplecov on Ruby 1.9.
21
+ * Version 0.2.4 - Added support for git and git-svn. Thanks to [Sylvestre Mergulhão][sm] and [Eduardo Fiorezi][edu].
22
+ * Version 0.2.3 - BUG FIX: Rake db:migrate fails when default RAILS\_ENV is used. Thanks to Celestino Gomes for fix this bug.
23
+ * Version 0.2.2 - Removed vendor/plugins/* commit. This commit is necessary when use plugins with externals but it is not a good practice. Piston is the correct way to use externals plugins. If you want to use externals commit in your integration process you can create a svn:commit:after task.
24
+ * Version 0.2.1 - BUG FIX: Setting 'RAILS\_ENV' wasn't affecting migrations. This bug fix changes this behavior and makes sure that 'RAILS_ENV' set by the user will always be respected, for all tasks. Thanks to Sylvestre Mergulhão for point this out.
25
+ * Version 0.2 - Added support for SKIP\_COMMIT\_MESSAGES'.
26
+
27
+ [edu]: http://about.me/eduardofiorezi
28
+ [sm]: https://github.com/mergulhao
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in he_integration.gemspec
4
+ gemspec
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013 HE:labs
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.mkdn ADDED
@@ -0,0 +1,163 @@
1
+ # Jumpup
2
+
3
+ ## What
4
+
5
+ Jumpup is a [Ruby on Rails][ror] plugin that provides a set of tasks to automate all steps of a [synchronous continuous integration][sci] process, that is, [continuous integration][ci] without a server such as [CruiseControl][cc]. Why? Because that's the way we like it!
6
+
7
+ ## Installing
8
+
9
+ Add it to your Gemfile:
10
+
11
+ group :development do
12
+ gem 'jumpup'
13
+ end
14
+
15
+ After installing the plugin is ready to be used and you will need to execute only one task in order to integrate your code safely:
16
+
17
+ rake integrate
18
+
19
+ ## Dependencies
20
+
21
+ * Git
22
+ * [Hpricot][h] to verify coverage
23
+ * [Rcov][rc](Ruby 1.8) or [Simplecov][sc](Ruby 1.9) (optional)
24
+
25
+ ## [ProTip] Using Simplecov
26
+
27
+ Using simplecov on your test suite will make your tests to run slower. You can fix it using an environment variable called "coverage" on test_helper.rb/spec_helper.rb to turn on/off the simplecov. See below:
28
+
29
+ spec_helper.rb or test_helper.rb
30
+
31
+ if ENV['coverage'] == 'on'
32
+ require 'simplecov'
33
+ SimpleCov.start 'rails'
34
+ end
35
+
36
+ The "coverage" variable is set to "on" by the integration process. When running tests/specs while you're developing, simplecov doesn't run, unless you set "coverage" environment variable by hand.
37
+
38
+ ## Integration Steps
39
+
40
+ The integration process is composed of several steps that are explained ahead. It's possible to skip one or more steps and add other steps of your own. This will be demonstrated shortly. The complete set of steps are:
41
+
42
+ 1. task git:status_check
43
+
44
+ Check if all local files are under control of your scm.
45
+
46
+ * task log:clear
47
+
48
+ Remove log files.
49
+
50
+ * task tmp:clear
51
+
52
+ Remove temporary files.
53
+
54
+ * task backup:local
55
+
56
+ Backup files locally. This is done before scm update to create a recovery point if you have problems during scm update. If a file merge creates undesirable effects on the software, you can recover from the backup file.
57
+ Backup file names have a timestamp. By default, the last 30 backups are kept. You may change this number as you'll see shortly. This task won't work on Windows because it uses [tar][]. So, if you're using Windows you'll have to write your own version of this task or just stop using Windows. We highly recommend the later.
58
+
59
+ * task git:pull
60
+
61
+ Update local files from your remote scm repository.
62
+
63
+ * task db:migrate
64
+
65
+ Execute any new database migration created by other team members since the last integration.
66
+
67
+ * Your test/spec suite
68
+
69
+ Set the rake task your test/spec suite needs to run. Use a command that generate the coverage files.
70
+
71
+ * coverage_verify
72
+
73
+ Check if tests/specs cover 100% of the application code.
74
+
75
+ * git:push
76
+
77
+ Push your changes. If any of the previous tasks break, because one test failed, for instance, the script won't push. Actually this task runs only if every checking done before work well.
78
+
79
+ Using this almost paranoid sequence of steps it will be hard to check in bad code in your repository, which is good, very good. The idea is that you should treat your repository as a sacred place, where only good code should ever enter.
80
+
81
+ ### More examples
82
+
83
+ * Reckless programmer
84
+
85
+ So you don't have tests, nor specs but you still want to use the jumpup. You might get away with this customized lib/tasks/integration.rake:
86
+
87
+ INTEGRATION_TASKS = %w(
88
+ integration:start
89
+ db:migrate
90
+ integration:finish
91
+ )
92
+
93
+ The fact that you can get away with this doesn't mean you should. Don't you think it's already time to grow up and become more professional about software development? I know you believe you have a great excuse to avoid writing those tests or specs. Still it's just an excuse. Write tests or write specs and make a better world!
94
+
95
+ * Test conscious programmer
96
+
97
+ You haven't jumped on the [BDD][BDD] bandwagon yet. Instead, you write tests, which is good, but they don't cover all of your code yet, which is bad. We believe you will improve it and make sure your tests cover 100% of your code. In the meantime you might need to skip coverage checkings. Oh, you also don't use [Selenium][sor]. Shame on you! Try this:
98
+
99
+ INTEGRATION_TASKS = %w(
100
+ integration:start
101
+ db:migrate
102
+ test
103
+ integration:finish
104
+ )
105
+
106
+ As a matter of fact, since this case might be very common, **we decided to create a lib/tasks/integration.rake for you once the plugin has been installed. It has this very configuration and you can use it as a starting point to customize your integration process**.
107
+
108
+ * Spec infected programmer
109
+
110
+ So you used to [TDD][TDD] all around but then someone told you that this is for gramma. The new wave has a name on it: [BDD][BDD]. So, of course, you now have specs covering 100% of your code and doesn't have any more tests. Great! Just do it:
111
+
112
+ INTEGRATION_TASKS = %w(
113
+ integration:start
114
+ db:migrate
115
+ spec
116
+ integration:coverage_verify
117
+ integration:finish
118
+ )
119
+
120
+ ## Versioning
121
+
122
+ Jumpup follow the [Semantic Versioning](http://semver.org/).
123
+
124
+ ## License
125
+
126
+ This code is free to be used under the terms of the [MIT license][mit].
127
+
128
+ ## Contact
129
+
130
+ Comments are welcome.
131
+
132
+ ## Authors
133
+
134
+ Jumpup came from the idea of [integration](https://github.com/tapajos/integration). Thanks to [Improve It][ii] and the original authors:
135
+
136
+ * [Marcos Tapajós][mt]
137
+ * [Sylvestre Mergulhão][sm]
138
+ * [Vinícius Teles][vt]
139
+
140
+
141
+ [piston]: http://piston.rubyforge.org/
142
+ [mt]: https://github.com/tapajos
143
+ [sm]: https://github.com/mergulhao
144
+ [vt]: http://www.improveit.com.br/vinicius
145
+ [f]: http://rubyforge.org/forum/?group_id=4662
146
+ [s]: http://subversion.tigris.org
147
+ [git]: http://git.or.cz/
148
+ [h]: http://code.whytheluckystiff.net/hpricot
149
+ [rc]: http://eigenclass.org/hiki.rb?rcov
150
+ [sc]: https://github.com/colszowka/simplecov
151
+ [sor]: http://selenium-on-rails.openqa.org
152
+ [rs]: http://rspec.info
153
+ [rz]: http://rubyzip.sourceforge.net/
154
+ [ror]: http://www.rubyonrails.org
155
+ [sci]: http://jamesshore.com/Blog/Why%20I%20Dont%20Like%20CruiseControl.html
156
+ [co]: http://www.improveit.com.br/en/contact
157
+ [mit]: http://www.opensource.org/licenses/mit-license.php
158
+ [ci]: http://martinfowler.com/articles/continuousIntegration.html
159
+ [cc]: http://cruisecontrol.sourceforge.net
160
+ [tar]: http://en.wikipedia.org/wiki/Tar_%28file_format%29
161
+ [BDD]: http://en.wikipedia.org/wiki/Behavior_driven_development
162
+ [TDD]: http://en.wikipedia.org/wiki/Test-driven_development
163
+ [ii]: http://www.improveit.com.br
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/jumpup.gemspec ADDED
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'jumpup/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "jumpup"
8
+ spec.version = Jumpup::VERSION
9
+ spec.authors = ["HE:labs"]
10
+ spec.email = ["contato@helabs.com.br"]
11
+ spec.description = %q{A synchronous continuous integration gem.}
12
+ spec.summary = %q{Jumpup gem help people that want to do synchronous continuous integration on their ruby projects.}
13
+ spec.homepage = "https://github.com/Helabs/jumpup"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+
24
+ spec.add_runtime_dependency('hpricot')
25
+ end
@@ -0,0 +1,3 @@
1
+ module Jumpup
2
+ VERSION = "0.0.1"
3
+ end
data/lib/jumpup.rb ADDED
@@ -0,0 +1 @@
1
+ Dir["#{Gem::Specification.find_by_name('jumpup').full_gem_path}/lib/tasks/*.rake"].each { |ext| load ext } if defined?(Rake)
@@ -0,0 +1,79 @@
1
+ require 'find'
2
+
3
+ namespace :integration do
4
+
5
+ def p80(message)
6
+ puts "-"*80
7
+ puts message if message
8
+ yield if block_given?
9
+ end
10
+
11
+ namespace :git do
12
+ desc 'Check if project can be committed to the repository.'
13
+ task :status_check do
14
+ result = `git status`
15
+ if result.include?('Untracked files:') || result.include?('unmerged:') || result.include?('modified:')
16
+ puts result
17
+ exit
18
+ end
19
+ end
20
+
21
+ desc 'Update files from repository.'
22
+ task :pull do
23
+ sh "git pull --rebase"
24
+ end
25
+
26
+ desc 'Push project.'
27
+ task :push do
28
+ sh "git push"
29
+ end
30
+ end
31
+
32
+ task :start => ["git:status_check", "log:clear", "tmp:clear", "git:pull"] do
33
+ ENV['coverage'] = 'on'
34
+ end
35
+ task :finish => ["git:push"]
36
+
37
+ desc 'Check code coverage'
38
+ task :coverage_verify do
39
+ sh "ruby #{File.expand_path(File.dirname(__FILE__) + '/../../test/coverage_test.rb')}"
40
+ end
41
+
42
+ desc 'Run bundle install'
43
+ task :bundle_install do
44
+ sh 'bundle install --quiet'
45
+ end
46
+
47
+ end
48
+
49
+ desc 'Integrate new code to repository'
50
+ task :integrate do
51
+ if !defined?(INTEGRATION_TASKS)
52
+ p80 %{
53
+ You should define INTEGRATION_TASKS constant. We recommend that you define it on lib/tasks/integration.rake file. The file doesn't exists. You should create it in your project.
54
+
55
+ You'll probably want to add coverage/ to your .gitignore file.
56
+
57
+ A sample content look like this:
58
+
59
+ INTEGRATION_TASKS = %w(
60
+ integration:start
61
+ integration:bundle_install
62
+ db:migrate
63
+ spec
64
+ integration:coverage_verify
65
+ jasmine:ci
66
+ integration:finish
67
+ )
68
+
69
+ }
70
+ exit
71
+ end
72
+
73
+ INTEGRATION_TASKS.each do |subtask|
74
+ p80("Executing #{subtask}...") do
75
+ RAILS_ENV = ENV['RAILS_ENV'] || 'development'
76
+ Rake::Task[subtask].invoke
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,22 @@
1
+ %w(test/unit rubygems hpricot).each { |lib| require lib }
2
+
3
+ class CoverageTest < Test::Unit::TestCase
4
+ COVERAGE_FILE = "coverage/index.html"
5
+ def test_if_application_is_fully_covered
6
+ doc = Hpricot(File.read(COVERAGE_FILE))
7
+
8
+ if RUBY_VERSION =~ /1.8/
9
+ files_without_coverage = doc.search("//div[@class='percent_graph_legend']").
10
+ search("//tt").
11
+ search("[text()!='100.00%']").
12
+ search('../../../td[1]/a')
13
+ else
14
+ files_without_coverage = doc.search("//div[@id='AllFiles']").
15
+ search("//td[2]").
16
+ search("//[text()!='100.0 %']").
17
+ search('../td[1]/a/')
18
+ end
19
+ assert files_without_coverage.empty?, "Bad Boy! Coverage is not 100%... \n Files with problem:\n\t#{files_without_coverage.collect{|file_name| file_name.inner_text}.join("\n\t")}"
20
+ puts "Congratulations! Your coverage is 100%!"
21
+ end
22
+ end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jumpup
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - HE:labs
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-08-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: hpricot
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: A synchronous continuous integration gem.
56
+ email:
57
+ - contato@helabs.com.br
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - .gitignore
63
+ - CHANGELOG.md
64
+ - Gemfile
65
+ - MIT-LICENSE
66
+ - README.mkdn
67
+ - Rakefile
68
+ - jumpup.gemspec
69
+ - lib/jumpup.rb
70
+ - lib/jumpup/version.rb
71
+ - lib/tasks/integrate.rake
72
+ - test/coverage_test.rb
73
+ homepage: https://github.com/Helabs/jumpup
74
+ licenses:
75
+ - MIT
76
+ metadata: {}
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.0.5
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: Jumpup gem help people that want to do synchronous continuous integration
97
+ on their ruby projects.
98
+ test_files:
99
+ - test/coverage_test.rb