deploy_version 0.0.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.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +21 -0
- data/README.rdoc +26 -0
- data/Rakefile +52 -0
- data/VERSION +1 -0
- data/lib/deploy_version.rb +59 -0
- data/test/helper.rb +10 -0
- data/test/test_deploy_version.rb +7 -0
- metadata +90 -0
data/.document
ADDED
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License
|
2
|
+
|
3
|
+
Copyright (c) <2010> <Kazuyoshi Tlacaelel>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
= Deploy Version
|
2
|
+
|
3
|
+
|
4
|
+
Keep track of which version is being deployed.
|
5
|
+
|
6
|
+
== Example usage
|
7
|
+
|
8
|
+
require 'deploy_version'
|
9
|
+
v = Deploy::Version.new
|
10
|
+
v.deployed_by = 'kazu'
|
11
|
+
v.current_version = '1.100.0'
|
12
|
+
v.store_to_file 'version.yml'
|
13
|
+
|
14
|
+
== Example output
|
15
|
+
|
16
|
+
File: version.yml
|
17
|
+
|
18
|
+
|
19
|
+
---
|
20
|
+
:current_version: 1.100.0
|
21
|
+
:deployed_by: kazu
|
22
|
+
:deployed_time: 2010-06-01 13:05:01.900989 -05:00
|
23
|
+
|
24
|
+
== License:
|
25
|
+
|
26
|
+
MIT. See the "LICENSE" file for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "deploy_version"
|
8
|
+
gem.summary = %Q{keep track of which version is being deployed.}
|
9
|
+
gem.description = %Q{Encapsulation for deploy version}
|
10
|
+
gem.email = "kazu.dev@gmail.com"
|
11
|
+
gem.homepage = "http://github.com/ktlacaelel/deploy_version"
|
12
|
+
gem.authors = ["kazuyoshi tlacaelel"]
|
13
|
+
gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
|
14
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
15
|
+
end
|
16
|
+
rescue LoadError
|
17
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
18
|
+
end
|
19
|
+
|
20
|
+
require 'rake/testtask'
|
21
|
+
Rake::TestTask.new(:test) do |test|
|
22
|
+
test.libs << 'lib' << 'test'
|
23
|
+
test.pattern = 'test/**/test_*.rb'
|
24
|
+
test.verbose = true
|
25
|
+
end
|
26
|
+
|
27
|
+
begin
|
28
|
+
require 'rcov/rcovtask'
|
29
|
+
Rcov::RcovTask.new do |test|
|
30
|
+
test.libs << 'test'
|
31
|
+
test.pattern = 'test/**/test_*.rb'
|
32
|
+
test.verbose = true
|
33
|
+
end
|
34
|
+
rescue LoadError
|
35
|
+
task :rcov do
|
36
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
task :test => :check_dependencies
|
41
|
+
|
42
|
+
task :default => :test
|
43
|
+
|
44
|
+
require 'rake/rdoctask'
|
45
|
+
Rake::RDocTask.new do |rdoc|
|
46
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
47
|
+
|
48
|
+
rdoc.rdoc_dir = 'rdoc'
|
49
|
+
rdoc.title = "deploy_version #{version}"
|
50
|
+
rdoc.rdoc_files.include('README*')
|
51
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
52
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.0
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'active_support'
|
3
|
+
|
4
|
+
module Deploy
|
5
|
+
|
6
|
+
class Error
|
7
|
+
|
8
|
+
end
|
9
|
+
|
10
|
+
class << Error
|
11
|
+
|
12
|
+
def not_implemented(method)
|
13
|
+
new("The method:[#{method}] hasn't been implemented yet.")
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
class Version
|
19
|
+
|
20
|
+
attr_accessor :current_version, :deployed_by, :time_zone
|
21
|
+
|
22
|
+
def initialize
|
23
|
+
@deployed_time = Time.now
|
24
|
+
end
|
25
|
+
|
26
|
+
def load_from_url
|
27
|
+
raise Error.not_implemented
|
28
|
+
end
|
29
|
+
|
30
|
+
def load_from_file
|
31
|
+
raise Error.not_implemented
|
32
|
+
end
|
33
|
+
|
34
|
+
def store_to_file(filename)
|
35
|
+
File.open(filename, 'w+') do |file|
|
36
|
+
file.puts export
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def time_zone=(value = 'EST')
|
41
|
+
Time.zone = value
|
42
|
+
@deployed_time = Time.zone.now
|
43
|
+
end
|
44
|
+
|
45
|
+
def deployed_time
|
46
|
+
@deployed_time
|
47
|
+
end
|
48
|
+
|
49
|
+
def export
|
50
|
+
{
|
51
|
+
:current_version => @current_version,
|
52
|
+
:deployed_by => @deployed_by,
|
53
|
+
:deployed_time => deployed_time
|
54
|
+
}.to_yaml
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
data/test/helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: deploy_version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 31
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 0.0.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- kazuyoshi tlacaelel
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-06-01 00:00:00 -05:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: thoughtbot-shoulda
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
type: :development
|
34
|
+
version_requirements: *id001
|
35
|
+
description: Encapsulation for deploy version
|
36
|
+
email: kazu.dev@gmail.com
|
37
|
+
executables: []
|
38
|
+
|
39
|
+
extensions: []
|
40
|
+
|
41
|
+
extra_rdoc_files:
|
42
|
+
- LICENSE
|
43
|
+
- README.rdoc
|
44
|
+
files:
|
45
|
+
- .document
|
46
|
+
- .gitignore
|
47
|
+
- LICENSE
|
48
|
+
- README.rdoc
|
49
|
+
- Rakefile
|
50
|
+
- VERSION
|
51
|
+
- lib/deploy_version.rb
|
52
|
+
- test/helper.rb
|
53
|
+
- test/test_deploy_version.rb
|
54
|
+
has_rdoc: true
|
55
|
+
homepage: http://github.com/ktlacaelel/deploy_version
|
56
|
+
licenses: []
|
57
|
+
|
58
|
+
post_install_message:
|
59
|
+
rdoc_options:
|
60
|
+
- --charset=UTF-8
|
61
|
+
require_paths:
|
62
|
+
- lib
|
63
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
hash: 3
|
69
|
+
segments:
|
70
|
+
- 0
|
71
|
+
version: "0"
|
72
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
hash: 3
|
78
|
+
segments:
|
79
|
+
- 0
|
80
|
+
version: "0"
|
81
|
+
requirements: []
|
82
|
+
|
83
|
+
rubyforge_project:
|
84
|
+
rubygems_version: 1.3.7
|
85
|
+
signing_key:
|
86
|
+
specification_version: 3
|
87
|
+
summary: keep track of which version is being deployed.
|
88
|
+
test_files:
|
89
|
+
- test/helper.rb
|
90
|
+
- test/test_deploy_version.rb
|