callsite 0.0.5 → 0.0.6

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.
@@ -0,0 +1 @@
1
+ pkg
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- callsite (0.0.5)
4
+ callsite (0.0.6)
5
5
  bundler (~> 1.0.0)
6
6
 
7
7
  GEM
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.homepage = %q{http://github.com/joshbuddy/callsite}
19
19
  s.rdoc_options = ["--charset=UTF-8"]
20
20
  s.require_paths = ["lib"]
21
- s.rubygems_version = %q{1.3.6}
21
+ s.rubygems_version = %q{1.3.5}
22
22
  s.summary = %q{Caller/backtrace parser with some useful utilities for manipulating the load path, and doing other relative things.}
23
23
  s.test_files = `git ls-files`.split("\n").select{|f| f[/^spec/]}
24
24
 
@@ -1,3 +1,3 @@
1
1
  module Callsite
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: callsite
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Joshua Hull
@@ -19,6 +19,7 @@ date: 2010-07-22 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
+ prerelease: false
22
23
  version_requirements: &id001 !ruby/object:Gem::Requirement
23
24
  none: false
24
25
  requirements:
@@ -31,10 +32,10 @@ dependencies:
31
32
  - 0
32
33
  version: 1.0.0
33
34
  requirement: *id001
34
- prerelease: false
35
- type: :runtime
36
35
  name: bundler
36
+ type: :runtime
37
37
  - !ruby/object:Gem::Dependency
38
+ prerelease: false
38
39
  version_requirements: &id002 !ruby/object:Gem::Requirement
39
40
  none: false
40
41
  requirements:
@@ -47,10 +48,10 @@ dependencies:
47
48
  - 7
48
49
  version: 0.8.7
49
50
  requirement: *id002
50
- prerelease: false
51
- type: :development
52
51
  name: rake
52
+ type: :development
53
53
  - !ruby/object:Gem::Dependency
54
+ prerelease: false
54
55
  version_requirements: &id003 !ruby/object:Gem::Requirement
55
56
  none: false
56
57
  requirements:
@@ -63,9 +64,8 @@ dependencies:
63
64
  - 0
64
65
  version: 1.3.0
65
66
  requirement: *id003
66
- prerelease: false
67
- type: :development
68
67
  name: rspec
68
+ type: :development
69
69
  description: Caller/backtrace parser with some useful utilities for manipulating the load path, and doing other relative things.
70
70
  email: joshbuddy@gmail.com
71
71
  executables: []
@@ -75,12 +75,12 @@ extensions: []
75
75
  extra_rdoc_files:
76
76
  - README.rdoc
77
77
  files:
78
+ - .gitignore
78
79
  - Gemfile
79
80
  - Gemfile.lock
80
81
  - README.rdoc
81
82
  - Rakefile
82
83
  - callsite.gemspec
83
- - ext/gem_rake.rb
84
84
  - lib/callsite.rb
85
85
  - lib/callsite/version.rb
86
86
  - lib/dirge.rb
@@ -1,126 +0,0 @@
1
- module Bundler
2
- class GemHelper
3
-
4
- def self.install_tasks
5
- dir = caller.find{|c| /Rakefile:/}[/^(.*?)\/Rakefile:/, 1]
6
- GemHelper.new(dir).install
7
- end
8
-
9
- attr_reader :spec_path, :base, :name
10
-
11
- def initialize(base, name = nil)
12
- @base = base
13
- @name = name || interpolate_name
14
- @spec_path = File.join(@base, "#{@name}.gemspec")
15
- end
16
-
17
- def install
18
- desc 'Build your gem into the pkg directory'
19
- task 'build' do
20
- build_gem
21
- end
22
-
23
- desc 'Install your gem into the pkg directory'
24
- task 'install' do
25
- install_gem
26
- end
27
-
28
- desc 'Push your gem to rubygems'
29
- task 'push' do
30
- push_gem
31
- end
32
- end
33
-
34
- def build_gem
35
- file_name = nil
36
- sh("gem build #{spec_path}") {
37
- file_name = File.basename(built_gem_path)
38
- FileUtils.mkdir_p(File.join(base, 'pkg'))
39
- FileUtils.mv(built_gem_path, 'pkg')
40
- }
41
- File.join(base, 'pkg', file_name)
42
- end
43
-
44
- def install_gem
45
- built_gem_path = build_gem
46
- sh("gem install #{built_gem_path}")
47
- end
48
-
49
- def push_gem
50
- guard_clean
51
- guard_already_tagged
52
- tag_version {
53
- git_push
54
- rubygem_push(build_gem)
55
- }
56
- end
57
-
58
- protected
59
- def rubygem_push(path)
60
- sh("gem push #{path}")
61
- end
62
-
63
- def built_gem_path
64
- Dir[File.join(base, "#{name}-*.gem")].sort_by{|f| File.mtime(f)}.last
65
- end
66
-
67
- def interpolate_name
68
- gemspecs = Dir[File.join(base, "*.gemspec")]
69
- raise "Unable to determine name from existing gemspec." unless gemspecs.size == 1
70
-
71
- File.basename(gemspecs.first)[/^(.*)\.gemspec$/, 1]
72
- end
73
-
74
- def git_push
75
- sh "git push --all"
76
- sh "git push --tags"
77
- end
78
-
79
- def guard_already_tagged
80
- sh('git tag').split(/\n/).include?(current_version_tag) and raise("This tag has already been committed to the repo.")
81
- end
82
-
83
- def guard_clean
84
- clean? or raise("There are files that need to be committed first.")
85
- end
86
-
87
- def clean?
88
- sh("git ls-files -dm").split("\n").size.zero?
89
- end
90
-
91
- def tag_version
92
- sh "git tag #{current_version_tag}"
93
- yield if block_given?
94
- rescue
95
- sh "git tag -d #{current_version_tag}"
96
- raise
97
- end
98
-
99
- def current_version
100
- raise("Version file could not be found at #{version_file_path}") unless File.exist?(version_file_path)
101
- File.read(version_file_path)[/V(ERSION|ersion)\s*=\s*(["'])(.*?)\2/, 3]
102
- end
103
-
104
- def version_file_path
105
- File.join(base, 'lib', name, 'version.rb')
106
- end
107
-
108
- def current_version_tag
109
- "v#{current_version}"
110
- end
111
-
112
- def sh(cmd, &block)
113
- output, code = sh_with_code(cmd, &block)
114
- code == 0 ? output : raise(output)
115
- end
116
-
117
- def sh_with_code(cmd, &block)
118
- output = ''
119
- Dir.chdir(base) {
120
- output = `#{cmd}`
121
- block.call if block and $? == 0
122
- }
123
- [output, $?]
124
- end
125
- end
126
- end