bones 3.7.1 → 3.7.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,14 @@
1
+ == 3.7.2 / 2011-11-17
2
+
3
+ Enhancements
4
+ - remove SMTP TLS patch for Ruby 1.8.6
5
+ - cleaning up rubygems deprecation warnings
6
+ - updating the default project skeleton
7
+ - ignore the .rvmrc file
8
+ - cleanup of comment lines
9
+ - minor tweak to the discovery of the root directory
10
+ - updating Rakefile
11
+
1
12
  == 3.7.1 / 2011-08-10
2
13
 
3
14
  Enhancements
data/Rakefile CHANGED
@@ -5,14 +5,13 @@ require 'bones'
5
5
  task :default => 'spec:run'
6
6
  task 'gem:release' => 'spec:run'
7
7
 
8
- begin gem('rspec', '~> 2.6.0'); rescue LoadError; end
8
+ begin gem('rspec', '~> 2.6'); rescue LoadError; end
9
9
 
10
10
  Bones {
11
11
  name 'bones'
12
12
  authors 'Tim Pease'
13
13
  email 'tim.pease@gmail.com'
14
14
  url 'http://rubygems.org/gems/bones'
15
- ruby_opts %w[-W0]
16
15
 
17
16
  spec.opts.concat %w[--color --format documentation]
18
17
  notes.exclude %w[^README\.rdoc$ ^data/]
@@ -31,10 +30,11 @@ Bones {
31
30
  depend_on 'little-plugger'
32
31
  depend_on 'loquacious'
33
32
 
34
- depend_on 'rspec', '~> 2.6.0', :development => true
33
+ depend_on 'rspec', '~> 2.6', :development => true
35
34
 
36
- # These are commented out to avoid circular dependencies when install
35
+ # These are commented out to avoid circular dependencies when installing
37
36
  # bones-git or bones-rspec in development mode
37
+ ####
38
38
  # depend_on 'bones-git', :development => true
39
39
  # depend_on 'bones-rspec', :development => true
40
40
  }
data/bin/bones CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
+ root = File.expand_path('../..', __FILE__)
4
4
 
5
5
  begin
6
6
  require File.join(root, %w[lib bones])
@@ -11,4 +11,3 @@ end
11
11
  Bones::App.initialize_plugins
12
12
  Bones::App.run
13
13
 
14
- # EOF
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require File.expand_path(
4
- File.join(File.dirname(__FILE__), %w[.. lib <%= name %>]))
3
+ root = File.expand_path('../..', __FILE__)
4
+ require File.join(root, %w[lib <%= name %>])
5
5
 
6
6
  # Put your code here
7
7
 
@@ -2,7 +2,7 @@
2
2
  module <%= classname %>
3
3
 
4
4
  # :stopdoc:
5
- LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
5
+ LIBPATH = ::File.expand_path('..', __FILE__) + ::File::SEPARATOR
6
6
  PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
7
7
  VERSION = ::File.read(PATH + 'version.txt').strip
8
8
  # :startdoc:
@@ -90,7 +90,6 @@ Bones.libpath {
90
90
  require 'bones/rake_override_task'
91
91
  require 'bones/gem_package_task'
92
92
  require 'bones/annotation_extractor'
93
- require 'bones/smtp_tls'
94
93
  require 'bones/app'
95
94
  require 'bones/app/command'
96
95
  require 'bones/app/file_manager'
@@ -119,4 +119,3 @@ DESCRIPTION
119
119
  end # class Main
120
120
  end # module Bones::App
121
121
 
122
- # EOF
@@ -7,7 +7,8 @@ class FileManager
7
7
 
8
8
  Error = Class.new(StandardError)
9
9
 
10
- attr_accessor :source, :destination, :archive, :verbose
10
+ attr_reader :destination
11
+ attr_accessor :source, :archive, :verbose
11
12
  alias :verbose? :verbose
12
13
 
13
14
  #
@@ -13,7 +13,7 @@ those gems. Passing in the 'all' flag will show plugins even if the related
13
13
  gems are not installed.
14
14
  __
15
15
 
16
- option('-a', '--all', 'Show all plugins.', lambda { config[:all] = true })
16
+ option('-a', '--all', 'Show all plugins.', lambda { |_| config[:all] = true })
17
17
  option(standard_options[:colorize])
18
18
  end
19
19
 
@@ -27,6 +27,7 @@ gems are not installed.
27
27
  if all?
28
28
  plugins.each { |name, version| show_plugin(name, version) }
29
29
  else
30
+ gemspecs = find_gemspecs
30
31
  plugins.each { |name, version|
31
32
  gemspecs.each { |gem_name, gem_version|
32
33
  next unless name.downcase == gem_name.downcase
@@ -52,11 +53,14 @@ gems are not installed.
52
53
 
53
54
  private
54
55
 
55
- def gemspecs
56
- specs = Gem.source_index.map { |_, spec| spec }
56
+ def find_gemspecs
57
+ if Gem::Specification.respond_to? :map
58
+ specs = Gem::Specification.map { |spec| spec }
59
+ else
60
+ specs = Gem.source_index.map { |_, spec| spec }
61
+ end
57
62
 
58
63
  specs.map! { |s| [s.name, s.version.segments.first] }
59
-
60
64
  specs.sort! { |a, b|
61
65
  names = a.first <=> b.first
62
66
  next names if names.nonzero?
@@ -68,7 +72,12 @@ private
68
72
  end
69
73
 
70
74
  def find_bones_plugins
71
- dep = Gem::Dependency.new(%r/^bones/i, Gem::Requirement.default)
75
+ if Gem.const_defined? :Deprecate
76
+ # FIXME: this needs to change when rubygems removes the option to pass a regular expression to the Gem::Dependency initializer
77
+ dep = Gem::Deprecate.skip_during { Gem::Dependency.new(%r/^bones/i, Gem::Requirement.default) }
78
+ else
79
+ dep = Gem::Dependency.new(%r/^bones/i, Gem::Requirement.default)
80
+ end
72
81
 
73
82
  fetcher = Gem::SpecFetcher.fetcher
74
83
  specs = fetcher.find_matching dep
@@ -84,8 +93,18 @@ private
84
93
  end
85
94
 
86
95
  def installed?( name, version = Gem::Requirement.default )
87
- dep = Gem::Dependency.new name, version
88
- !Gem.source_index.search(dep).empty?
96
+ # FIXME: check for rubygems version 1.8.X
97
+ if Gem::Specification.respond_to? :find_by_name
98
+ begin
99
+ Gem::Specification.find_by_name(name, version)
100
+ true
101
+ rescue Gem::LoadError => err
102
+ false
103
+ end
104
+ else
105
+ dep = Gem::Dependency.new name, version
106
+ !Gem.source_index.search(dep).empty?
107
+ end
89
108
  end
90
109
 
91
110
  end # class Plugins
@@ -1,4 +1,7 @@
1
1
 
2
+ require 'net/smtp'
3
+ require 'time'
4
+
2
5
  module Bones::Plugins::Ann
3
6
  include ::Bones::Helpers
4
7
  extend self
@@ -73,6 +76,11 @@ module Bones::Plugins::Ann
73
76
  one of :plain, :login, or :cram_md5. See the documentation on the
74
77
  Net::SMTP class for more information.
75
78
  __
79
+
80
+ enable_starttls_auto true, :desc => <<-__
81
+ When set to true, detects if STARTTLS is enabled in your SMTP server
82
+ and starts to use it. It works only on Ruby >= 1.8.7 and Ruby >= 1.9.
83
+ __
76
84
  }
77
85
  }
78
86
  }
@@ -143,15 +151,18 @@ module Bones::Plugins::Ann
143
151
  rfc822msg << "<#{"%.8f" % Time.now.to_f}@#{email.domain}>\n\n"
144
152
  rfc822msg << File.read(ann.file)
145
153
 
146
- params = [:server, :port, :domain, :username, :password, :authtype].map { |key| email[key] }
147
-
148
- if params[4].nil?
149
- STDOUT.write "Please enter your e-mail password (#{params[3]}): "
150
- params[4] = STDIN.gets.chomp
154
+ params = [:domain, :username, :password, :authtype].map { |key| email[key] }
155
+ if params[2].nil?
156
+ STDOUT.write "Please enter your e-mail password (#{params[1]}): "
157
+ params[2] = STDIN.gets.chomp
151
158
  end
152
159
 
153
160
  ### send email
154
- Net::SMTP.start(*params) {|smtp| smtp.sendmail(rfc822msg, from, to)}
161
+ smtp = Net::SMTP.new(email[:server], email[:port])
162
+ smtp.enable_starttls_auto if email[:enable_starttls_auto] and smtp.respond_to?(:enable_starttls_auto)
163
+ smtp.start(*params) { |_smtp_|
164
+ _smtp_.sendmail(rfc822msg, from, to)
165
+ }
155
166
  end
156
167
  end # namespace :ann
157
168
 
@@ -18,7 +18,6 @@ module Bones::Plugins::Gem
18
18
  development = opts.key?(:development) ? opts[:development] : opts.key?(:dev) ? opts[:dev] : false
19
19
 
20
20
  spec = nil
21
- # FIXME: check for rubygems version 1.8.X
22
21
  if Gem::Specification.respond_to? :find_by_name
23
22
  begin
24
23
  spec = Gem::Specification.find_by_name(name)
@@ -17,30 +17,30 @@ describe Bones::App::FileManager do
17
17
  @fm.source.should be_nil
18
18
 
19
19
  @fm.source = '/home/user/.mrbones/default'
20
- @fm.source.should == '/home/user/.mrbones/default'
20
+ @fm.source.should be == '/home/user/.mrbones/default'
21
21
  end
22
22
 
23
23
  it "should have a configurable destination" do
24
24
  @fm.destination.should be_nil
25
25
 
26
26
  @fm.destination = 'my_new_app'
27
- @fm.destination.should == 'my_new_app'
27
+ @fm.destination.should be == 'my_new_app'
28
28
  end
29
29
 
30
30
  it "should set the archive directory when the destination is set" do
31
31
  @fm.archive.should be_nil
32
32
 
33
33
  @fm.destination = 'my_new_app'
34
- @fm.archive.should == 'my_new_app.archive'
34
+ @fm.archive.should be == 'my_new_app.archive'
35
35
  end
36
36
 
37
37
  it "should return a list of files to copy" do
38
38
  @fm.source = Bones.path %w[spec data default]
39
39
 
40
40
  ary = @fm._files_to_copy
41
- ary.length.should == 8
41
+ ary.length.should be == 8
42
42
 
43
- ary.should == %w[
43
+ ary.should be == %w[
44
44
  .bnsignore
45
45
  .rvmrc.bns
46
46
  History
@@ -54,13 +54,13 @@ describe Bones::App::FileManager do
54
54
 
55
55
  it "should archive the destination directory if it exists" do
56
56
  @fm.destination = Bones.path(%w[spec data bar])
57
- test(?e, @fm.destination).should == false
58
- test(?e, @fm.archive).should == false
57
+ test(?e, @fm.destination).should be == false
58
+ test(?e, @fm.archive).should be == false
59
59
 
60
60
  FileUtils.mkdir @fm.destination
61
61
  @fm.archive_destination
62
- test(?e, @fm.destination).should == false
63
- test(?e, @fm.archive).should == true
62
+ test(?e, @fm.destination).should be == false
63
+ test(?e, @fm.archive).should be == true
64
64
  end
65
65
 
66
66
  it "should rename files and folders containing 'NAME'" do
@@ -71,8 +71,8 @@ describe Bones::App::FileManager do
71
71
  @fm._rename(File.join(@fm.destination, 'NAME'), 'tirion')
72
72
 
73
73
  dir = File.join(@fm.destination, 'tirion')
74
- test(?d, dir).should == true
75
- test(?f, File.join(dir, 'tirion.rb.bns')).should == true
74
+ test(?d, dir).should be == true
75
+ test(?f, File.join(dir, 'tirion.rb.bns')).should be == true
76
76
  end
77
77
 
78
78
  it "should raise an error when renaming an existing file or folder" do
@@ -90,18 +90,18 @@ describe Bones::App::FileManager do
90
90
  @fm.template('foo_bar')
91
91
 
92
92
  dir = @fm.destination
93
- test(?e, File.join(dir, 'Rakefile.bns')).should == false
94
- test(?e, File.join(dir, 'README.md.bns')).should == false
95
- test(?e, File.join(dir, %w[foo_bar foo_bar.rb.bns])).should == false
96
- test(?e, File.join(dir, '.rvmrc.bns')).should == false
93
+ test(?e, File.join(dir, 'Rakefile.bns')).should be == false
94
+ test(?e, File.join(dir, 'README.md.bns')).should be == false
95
+ test(?e, File.join(dir, %w[foo_bar foo_bar.rb.bns])).should be == false
96
+ test(?e, File.join(dir, '.rvmrc.bns')).should be == false
97
97
 
98
- test(?e, File.join(dir, 'Rakefile')).should == true
99
- test(?e, File.join(dir, 'README.md')).should == true
100
- test(?e, File.join(dir, %w[foo_bar foo_bar.rb])).should == true
101
- test(?e, File.join(dir, '.rvmrc')).should == true
98
+ test(?e, File.join(dir, 'Rakefile')).should be == true
99
+ test(?e, File.join(dir, 'README.md')).should be == true
100
+ test(?e, File.join(dir, %w[foo_bar foo_bar.rb])).should be == true
101
+ test(?e, File.join(dir, '.rvmrc')).should be == true
102
102
 
103
103
  txt = File.read(File.join(@fm.destination, %w[foo_bar foo_bar.rb]))
104
- txt.should == <<-TXT
104
+ txt.should be == <<-TXT
105
105
  module FooBar
106
106
  def self.foo_bar
107
107
  p 'just a test'
@@ -116,8 +116,8 @@ end
116
116
  @fm.template('foo_bar')
117
117
 
118
118
  dir = @fm.destination
119
- test(?e, File.join(dir, 'bin/foo_bar')).should == true
120
- test(?x, File.join(dir, 'bin/foo_bar')).should == true
119
+ test(?e, File.join(dir, 'bin/foo_bar')).should be == true
120
+ test(?x, File.join(dir, 'bin/foo_bar')).should be == true
121
121
  end
122
122
 
123
123
  # ------------------------------------------------------------------------
@@ -125,32 +125,32 @@ end
125
125
 
126
126
  it "should recognize a git repository" do
127
127
  @fm.source = 'git://github.com/TwP/bones.git'
128
- @fm.repository.should == :git
128
+ @fm.repository.should be == :git
129
129
 
130
130
  @fm.source = 'git://github.com/TwP/bones.git/'
131
- @fm.repository.should == :git
131
+ @fm.repository.should be == :git
132
132
  end
133
133
 
134
134
  it "should recognize an svn repository" do
135
135
  @fm.source = 'file:///home/user/svn/ruby/trunk/apc'
136
- @fm.repository.should == :svn
136
+ @fm.repository.should be == :svn
137
137
 
138
138
  @fm.source = 'http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8'
139
- @fm.repository.should == :svn
139
+ @fm.repository.should be == :svn
140
140
 
141
141
  @fm.source = 'https://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8'
142
- @fm.repository.should == :svn
142
+ @fm.repository.should be == :svn
143
143
 
144
144
  @fm.source = 'svn://10.10.10.10/project/trunk'
145
- @fm.repository.should == :svn
145
+ @fm.repository.should be == :svn
146
146
 
147
147
  @fm.source = 'svn+ssh://10.10.10.10/project/trunk'
148
- @fm.repository.should == :svn
148
+ @fm.repository.should be == :svn
149
149
  end
150
150
 
151
151
  it "should return nil if the source is not a repository" do
152
152
  @fm.source = '/some/directory/on/your/hard/drive'
153
- @fm.repository.should == nil
153
+ @fm.repository.should be_nil
154
154
  end
155
155
  end
156
156
 
@@ -37,22 +37,22 @@ describe Bones::App do
37
37
 
38
38
  it 'should provide a create command' do
39
39
  @app.run %w[create]
40
- @runner.name.should == :create
40
+ @runner.name.should be == :create
41
41
  end
42
42
 
43
43
  it 'should provide a freeze command' do
44
44
  @app.run %w[freeze]
45
- @runner.name.should == :freeze
45
+ @runner.name.should be == :freeze
46
46
  end
47
47
 
48
48
  it 'should provide an unfreeze command' do
49
49
  @app.run %w[unfreeze]
50
- @runner.name.should == :unfreeze
50
+ @runner.name.should be == :unfreeze
51
51
  end
52
52
 
53
53
  it 'should provide an info command' do
54
54
  @app.run %w[info]
55
- @runner.name.should == :info
55
+ @runner.name.should be == :info
56
56
  end
57
57
 
58
58
  it 'should provide a help command' do
@@ -74,17 +74,17 @@ describe Bones::App do
74
74
 
75
75
  it 'should report an error for unrecognized commands' do
76
76
  lambda {@app.run %w[foo]}.should raise_error(SystemExit)
77
- @err.readline.should == "\e[37m\e[41mERROR\e[0m: While executing bones ..."
78
- @err.readline.should == ' Unknown command "foo"'
77
+ @err.readline.should be == "\e[37m\e[41mERROR\e[0m: While executing bones ..."
78
+ @err.readline.should be == ' Unknown command "foo"'
79
79
  end
80
80
 
81
81
  it 'should report a version number' do
82
82
  @app.run %w[--version]
83
- @out.readline.should == "Mr Bones v#{Bones.version}"
83
+ @out.readline.should be == "Mr Bones v#{Bones.version}"
84
84
  @out.clear
85
85
 
86
86
  @app.run %w[-v]
87
- @out.readline.should == "Mr Bones v#{Bones.version}"
87
+ @out.readline.should be == "Mr Bones v#{Bones.version}"
88
88
  end
89
89
 
90
90
  end # describe Bones::App
@@ -10,12 +10,12 @@ describe Bones::Helpers do
10
10
  describe 'when given a list of files' do
11
11
  it 'finds the one that exists on the filesystem' do
12
12
  filename = Bones::Helpers.find_file(*%w[foo.txt bar.txt README History.txt baz buz])
13
- filename.should == 'History.txt'
13
+ filename.should be == 'History.txt'
14
14
  end
15
15
 
16
16
  it 'returns the first file if none exist' do
17
17
  filename = Bones::Helpers.find_file(*%w[foo.txt bar.txt README History baz buz])
18
- filename.should == 'foo.txt'
18
+ filename.should be == 'foo.txt'
19
19
  end
20
20
  end
21
21
 
@@ -24,39 +24,39 @@ describe Bones::Helpers do
24
24
  filename = Bones.path %w[spec data rdoc.txt]
25
25
 
26
26
  ary = Bones::Helpers.paragraphs_of(filename, 'install')
27
- ary.length.should == 6
28
- ary.first.should == '* gem install bones'
29
- ary.last.should == %Q{The 'bones-git' gem provides command line options for generating a git\nrepository and pushing to github upon creation. Rake tasks for working with\nthe git repository are also provided.}
27
+ ary.length.should be == 6
28
+ ary.first.should be == '* gem install bones'
29
+ ary.last.should be == %Q{The 'bones-git' gem provides command line options for generating a git\nrepository and pushing to github upon creation. Rake tasks for working with\nthe git repository are also provided.}
30
30
 
31
31
  ary = Bones::Helpers.paragraphs_of(filename, 'description')
32
- ary.length.should == 1
32
+ ary.length.should be == 1
33
33
 
34
34
  ary = Bones::Helpers.paragraphs_of(filename, 'license')
35
- ary.length.should == 4
35
+ ary.length.should be == 4
36
36
  end
37
37
 
38
38
  it 'recognizes Markdown headers by title' do
39
39
  filename = Bones.path %w[spec data markdown.txt]
40
40
 
41
41
  ary = Bones::Helpers.paragraphs_of(filename, 'install')
42
- ary.length.should == 5
43
- ary.first.should == '* gem install bones'
44
- ary.last.should == %Q{The 'bones-extras' gem provides rake tasks for running Rspec tests, running\nRcov on your source code, and pushing releases to RubyForge. You will need to\nhave the corresponding gems installed for these tasks to be loaded.}
42
+ ary.length.should be == 5
43
+ ary.first.should be == '* gem install bones'
44
+ ary.last.should be == %Q{The 'bones-extras' gem provides rake tasks for running Rspec tests, running\nRcov on your source code, and pushing releases to RubyForge. You will need to\nhave the corresponding gems installed for these tasks to be loaded.}
45
45
 
46
46
  ary = Bones::Helpers.paragraphs_of(filename, 'mr bones')
47
- ary.length.should == 1
47
+ ary.length.should be == 1
48
48
 
49
49
  ary = Bones::Helpers.paragraphs_of(filename, 'license')
50
- ary.length.should == 4
50
+ ary.length.should be == 4
51
51
  end
52
52
 
53
53
  it 'uses paragraph numbers' do
54
54
  filename = Bones.path %w[spec data markdown.txt]
55
55
 
56
56
  ary = Bones::Helpers.paragraphs_of(filename, 0, 1..3)
57
- ary.length.should == 4
58
- ary.first.should == %Q{Mr Bones is a handy tool that creates new Ruby projects from a code\nskeleton. The skeleton contains some starter code and a collection of rake\ntasks to ease the management and deployment of your source code. Several Mr\nBones plugins are available for creating git repositories, creating GitHub\nprojects, running various test suites and source code analysis tools.}
59
- ary.last.should == %Q{When working with Rake, Mr Bones provides a set of tasks that help simplify\ncommon development tasks. These tasks include ...}
57
+ ary.length.should be == 4
58
+ ary.first.should be == %Q{Mr Bones is a handy tool that creates new Ruby projects from a code\nskeleton. The skeleton contains some starter code and a collection of rake\ntasks to ease the management and deployment of your source code. Several Mr\nBones plugins are available for creating git repositories, creating GitHub\nprojects, running various test suites and source code analysis tools.}
59
+ ary.last.should be == %Q{When working with Rake, Mr Bones provides a set of tasks that help simplify\ncommon development tasks. These tasks include ...}
60
60
  end
61
61
  end
62
62
 
@@ -1 +1 @@
1
- 3.7.1
1
+ 3.7.2
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bones
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.1
4
+ version: 3.7.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-10 00:00:00.000000000Z
12
+ date: 2011-11-17 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &2165990200 !ruby/object:Gem::Requirement
16
+ requirement: &2152697060 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.8.7
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2165990200
24
+ version_requirements: *2152697060
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: little-plugger
27
- requirement: &2165989480 !ruby/object:Gem::Requirement
27
+ requirement: &2152695600 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,29 +32,29 @@ dependencies:
32
32
  version: 1.1.2
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2165989480
35
+ version_requirements: *2152695600
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: loquacious
38
- requirement: &2165982300 !ruby/object:Gem::Requirement
38
+ requirement: &2152694360 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
42
42
  - !ruby/object:Gem::Version
43
- version: 1.8.1
43
+ version: 1.9.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2165982300
46
+ version_requirements: *2152694360
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &2165981760 !ruby/object:Gem::Requirement
49
+ requirement: &2152693360 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: 2.6.0
54
+ version: '2.6'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2165981760
57
+ version_requirements: *2152693360
58
58
  description: ! 'Mr Bones is a handy tool that creates new Ruby projects from a code
59
59
 
60
60
  skeleton. The skeleton contains some starter code and a collection of rake
@@ -111,7 +111,6 @@ files:
111
111
  - lib/bones/plugins/rdoc.rb
112
112
  - lib/bones/plugins/test.rb
113
113
  - lib/bones/rake_override_task.rb
114
- - lib/bones/smtp_tls.rb
115
114
  - spec/bones/app/file_manager_spec.rb
116
115
  - spec/bones/app_spec.rb
117
116
  - spec/bones/helpers_spec.rb
@@ -152,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
151
  version: '0'
153
152
  requirements: []
154
153
  rubyforge_project: bones
155
- rubygems_version: 1.8.6
154
+ rubygems_version: 1.8.11
156
155
  signing_key:
157
156
  specification_version: 3
158
157
  summary: Mr Bones is a handy tool that creates new Ruby projects from a code skeleton.
@@ -1,81 +0,0 @@
1
-
2
- # This code enables SMTPTLS authentication requireed for sending mail
3
- # via the gmail servers. I found this code via a blog entry from James
4
- # Britt.
5
- #
6
- # http://d.hatena.ne.jp/zorio/20060416
7
- # http://www.jamesbritt.com/2007/12/18/sending-mail-through-gmail-with-ruby-s-net-smtp
8
-
9
- begin
10
- require "openssl"
11
- require "net/smtp"
12
- require 'time'
13
-
14
- Net::SMTP.class_eval do
15
- private
16
- def do_start(helodomain, user, secret, authtype)
17
- raise IOError, 'SMTP session already started' if @started
18
-
19
- if user or secret
20
- if 3 == self.method(:check_auth_args).arity
21
- check_auth_args(user, secret, authtype)
22
- else
23
- check_auth_args(user, secret)
24
- end
25
- end
26
-
27
- sock = timeout(@open_timeout) { TCPSocket.open(@address, @port) }
28
- @socket = Net::InternetMessageIO.new(sock)
29
- @socket.read_timeout = 60 #@read_timeout
30
- @socket.debug_output = STDERR #@debug_output
31
-
32
- check_response(critical { recv_response() })
33
- do_helo(helodomain)
34
-
35
- raise 'openssl library not installed' unless defined?(OpenSSL)
36
- starttls
37
- ssl = OpenSSL::SSL::SSLSocket.new(sock)
38
- ssl.sync_close = true
39
- ssl.connect
40
- @socket = Net::InternetMessageIO.new(ssl)
41
- @socket.read_timeout = 60 #@read_timeout
42
- @socket.debug_output = STDERR #@debug_output
43
- do_helo(helodomain)
44
-
45
- authenticate user, secret, authtype if user
46
- @started = true
47
- ensure
48
- unless @started
49
- # authentication failed, cancel connection.
50
- @socket.close if not @started and @socket and not @socket.closed?
51
- @socket = nil
52
- end
53
- end
54
-
55
- def do_helo(helodomain)
56
- begin
57
- if @esmtp
58
- ehlo helodomain
59
- else
60
- helo helodomain
61
- end
62
- rescue Net::ProtocolError
63
- if @esmtp
64
- @esmtp = false
65
- @error_occured = false
66
- retry
67
- end
68
- raise
69
- end
70
- end
71
-
72
- def starttls
73
- getok('STARTTLS')
74
- end
75
- end
76
-
77
- # We cannot do TLS if we do not have 'openssl'
78
- rescue LoadError
79
- end
80
-
81
- # EOF