htauth 1.0.1 → 1.0.2

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,59 @@
1
+ require 'tasks/config'
2
+
3
+ #-----------------------------------------------------------------------
4
+ # Rubyforge additions to the task library
5
+ #-----------------------------------------------------------------------
6
+ if rf_conf = Configuration.for_if_exist?("rubyforge") then
7
+
8
+ abort("rubyforge gem not installed 'gem install rubyforge'") unless Utils.try_require('rubyforge')
9
+
10
+ proj_conf = Configuration.for('project')
11
+
12
+ namespace :dist do
13
+ desc "Release files to rubyforge"
14
+ task :rubyforge => [:clean, :package ] do
15
+
16
+ rubyforge = RubyForge.new
17
+
18
+ config = {}
19
+ config["release_notes"] = proj_conf.description
20
+ config["release_changes"] = Utils.release_notes_from(proj_conf.history)[HTAuth::VERSION]
21
+ config["Prefomatted"] = true
22
+
23
+ rubyforge.configure config
24
+
25
+ # make sure this release doesn't already exist
26
+ releases = rubyforge.autoconfig['release_ids']
27
+ if releases.has_key?(HTAuth::GEM_SPEC.name) and releases[HTAuth::GEM_SPEC.name][HTAuth::VERSION] then
28
+ abort("Release #{HTAuth::VERSION} already exists! Unable to release.")
29
+ end
30
+
31
+ puts "Uploading to rubyforge..."
32
+ files = FileList[File.join("pkg","#{HTAuth::GEM_SPEC.name}-#{HTAuth::VERSION}*.*")].to_a
33
+ files.each do |f|
34
+ puts " * #{f}"
35
+ end
36
+ rubyforge.login
37
+ rubyforge.add_release(HTAuth::GEM_SPEC.rubyforge_project, HTAuth::GEM_SPEC.name, HTAuth::VERSION, *files)
38
+ puts "done."
39
+ end
40
+ end
41
+
42
+ namespace :announce do
43
+ desc "Post news of #{proj_conf.name} to #{rf_conf.project} on rubyforge"
44
+ task :rubyforge do
45
+ info = Utils.announcement
46
+
47
+ puts "Subject : #{info[:subject]}"
48
+ msg = "#{info[:title]}\n\n#{info[:urls]}\n\n#{info[:release_notes]}"
49
+ puts msg
50
+
51
+ rubyforge = RubyForge.new
52
+ rubyforge.configure
53
+ rubyforge.login
54
+ rubyforge.post_news(rf_conf.project, info[:subject], msg )
55
+ puts "Posted to rubyforge"
56
+ end
57
+
58
+ end
59
+ end
@@ -0,0 +1,80 @@
1
+ require 'crate/version'
2
+
3
+ #-------------------------------------------------------------------------------
4
+ # Additions to the Configuration class that are useful
5
+ #-------------------------------------------------------------------------------
6
+ class Configuration
7
+ class << self
8
+ def exist?( name )
9
+ Configuration::Table.has_key?( name )
10
+ end
11
+
12
+ def for_if_exist?( name )
13
+ if self.exist?( name ) then
14
+ self.for( name )
15
+ end
16
+ end
17
+ end
18
+ end
19
+
20
+ #-------------------------------------------------------------------------------
21
+ # some useful utilitiy methods for the tasks
22
+ #-------------------------------------------------------------------------------
23
+ module Utils
24
+ class << self
25
+
26
+ # Try to load the given _library_ using the built-in require, but do not
27
+ # raise a LoadError if unsuccessful. Returns +true+ if the _library_ was
28
+ # successfully loaded; returns +false+ otherwise.
29
+ #
30
+ def try_require( lib )
31
+ require lib
32
+ true
33
+ rescue LoadError
34
+ false
35
+ end
36
+
37
+ # partition an rdoc file into sections, and return the text of the section
38
+ # given.
39
+ def section_of(file, section_name)
40
+ File.read(file).split(/^(?==)/).each do |section|
41
+ lines = section.split("\n")
42
+ return lines[1..-1].join("\n").strip if lines.first =~ /#{section_name}/i
43
+ end
44
+ nil
45
+ end
46
+
47
+ # Get an array of all the changes in the application for a particular
48
+ # release. This is done by looking in the history file and grabbing the
49
+ # information for the most recent release. The history file is assumed to
50
+ # be in RDoc format and version release are 2nd tier sections separated by
51
+ # '== Version X.Y.Z'
52
+ #
53
+ # returns:: A hash of notes keyed by version number
54
+ #
55
+ def release_notes_from(history_file)
56
+ releases = {}
57
+ File.read(history_file).split(/^(?==)/).each do |section|
58
+ lines = section.split("\n")
59
+ md = %r{Version ((\w+\.)+\w+)}.match(lines.first)
60
+ next unless md
61
+ releases[md[1]] = lines[1..-1].join("\n").strip
62
+ end
63
+ return releases
64
+ end
65
+
66
+ # return a hash of useful information for the latest release
67
+ # urls, subject, title, description and latest release notes
68
+ #
69
+ def announcement
70
+ cfg = Configuration.for("project")
71
+ {
72
+ :subject => "#{cfg.name} #{HTAuth::VERSION} Released",
73
+ :title => "#{cfg.name} version #{HTAuth::VERSION} has been released.",
74
+ :urls => "#{cfg.homepage}",
75
+ :description => "#{cfg.description.rstrip}",
76
+ :release_notes => Utils.release_notes_from(cfg.history)[HTAuth::VERSION].rstrip
77
+ }
78
+ end
79
+ end
80
+ end # << self
metadata CHANGED
@@ -1,58 +1,38 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: htauth
5
3
  version: !ruby/object:Gem::Version
6
- version: 1.0.1
7
- date: 2008-02-06 00:00:00 -07:00
8
- summary: HTAuth provides htdigest and htpasswd support.
9
- require_paths:
10
- - lib
11
- email: jeremy@hinegardner.org
12
- homepage: http://copiousfreetime.rubyforge.org/htauth
13
- rubyforge_project: copiousfreetime
14
- description: HTAuth is a pure ruby replacement for the Apache support programs htdigest and htpasswd. Command line and API access are provided for access to htdigest and htpasswd files.
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 1.0.2
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message: |
29
- Try out 'htpasswd-ruby' or 'htdigest-ruby' to get started.
30
-
31
6
  authors:
32
7
  - Jeremy Hinegardner
33
- files:
34
- - spec/crypt_spec.rb
35
- - spec/digest_entry_spec.rb
36
- - spec/digest_file_spec.rb
37
- - spec/digest_spec.rb
38
- - spec/md5_spec.rb
39
- - spec/passwd_entry_spec.rb
40
- - spec/passwd_file_spec.rb
41
- - spec/passwd_spec.rb
42
- - spec/plaintext_spec.rb
43
- - spec/sha1_spec.rb
44
- - spec/spec_helper.rb
45
- - spec/test.add.digest
46
- - spec/test.add.passwd
47
- - spec/test.delete.digest
48
- - spec/test.delete.passwd
49
- - spec/test.original.digest
50
- - spec/test.original.passwd
51
- - spec/test.update.digest
52
- - spec/test.update.passwd
53
- - CHANGES
54
- - LICENSE
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-11-30 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: highline
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ~>
22
+ - !ruby/object:Gem::Version
23
+ version: 1.4.0
24
+ version:
25
+ description: HTAuth is a pure ruby replacement for the Apache support programs htdigest and htpasswd. Command line and API access are provided for access to htdigest and htpasswd files.
26
+ email: jeremy@copiousfreetime.org
27
+ executables:
28
+ - htdigest-ruby
29
+ - htpasswd-ruby
30
+ extensions: []
31
+
32
+ extra_rdoc_files:
55
33
  - README
34
+ - HISTORY
35
+ - LICENSE
56
36
  - lib/htauth/algorithm.rb
57
37
  - lib/htauth/crypt.rb
58
38
  - lib/htauth/digest.rb
@@ -60,19 +40,32 @@ files:
60
40
  - lib/htauth/digest_file.rb
61
41
  - lib/htauth/entry.rb
62
42
  - lib/htauth/file.rb
63
- - lib/htauth/gemspec.rb
64
43
  - lib/htauth/md5.rb
65
44
  - lib/htauth/passwd.rb
66
45
  - lib/htauth/passwd_entry.rb
67
46
  - lib/htauth/passwd_file.rb
68
47
  - lib/htauth/plaintext.rb
69
48
  - lib/htauth/sha1.rb
70
- - lib/htauth/specification.rb
71
49
  - lib/htauth/version.rb
72
50
  - lib/htauth.rb
51
+ files:
73
52
  - bin/htdigest-ruby
74
53
  - bin/htpasswd-ruby
75
- test_files:
54
+ - lib/htauth/algorithm.rb
55
+ - lib/htauth/crypt.rb
56
+ - lib/htauth/digest.rb
57
+ - lib/htauth/digest_entry.rb
58
+ - lib/htauth/digest_file.rb
59
+ - lib/htauth/entry.rb
60
+ - lib/htauth/file.rb
61
+ - lib/htauth/md5.rb
62
+ - lib/htauth/passwd.rb
63
+ - lib/htauth/passwd_entry.rb
64
+ - lib/htauth/passwd_file.rb
65
+ - lib/htauth/plaintext.rb
66
+ - lib/htauth/sha1.rb
67
+ - lib/htauth/version.rb
68
+ - lib/htauth.rb
76
69
  - spec/crypt_spec.rb
77
70
  - spec/digest_entry_spec.rb
78
71
  - spec/digest_file_spec.rb
@@ -84,48 +77,45 @@ test_files:
84
77
  - spec/plaintext_spec.rb
85
78
  - spec/sha1_spec.rb
86
79
  - spec/spec_helper.rb
87
- - spec/test.add.digest
88
- - spec/test.add.passwd
89
- - spec/test.delete.digest
90
- - spec/test.delete.passwd
91
- - spec/test.original.digest
92
- - spec/test.original.passwd
93
- - spec/test.update.digest
94
- - spec/test.update.passwd
80
+ - README
81
+ - HISTORY
82
+ - LICENSE
83
+ - tasks/announce.rake
84
+ - tasks/distribution.rake
85
+ - tasks/documentation.rake
86
+ - tasks/rspec.rake
87
+ - tasks/rubyforge.rake
88
+ - tasks/config.rb
89
+ - tasks/utils.rb
90
+ - gemspec.rb
91
+ has_rdoc: true
92
+ homepage: http://copiousfreetime.rubyforge.org/htauth
93
+ post_install_message:
95
94
  rdoc_options:
96
95
  - --line-numbers
97
96
  - --inline-source
98
97
  - --main
99
98
  - README
100
- - --title
101
- - "'htauth -- HTAuth provides htdigest and htpasswd support.'"
102
- extra_rdoc_files:
103
- - CHANGES
104
- - LICENSE
105
- - README
106
- executables:
107
- - htdigest-ruby
108
- - htpasswd-ruby
109
- extensions: []
110
-
99
+ require_paths:
100
+ - lib
101
+ required_ruby_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: "0"
106
+ version:
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: "0"
112
+ version:
111
113
  requirements: []
112
114
 
113
- dependencies:
114
- - !ruby/object:Gem::Dependency
115
- name: rake
116
- version_requirement:
117
- version_requirements: !ruby/object:Gem::Version::Requirement
118
- requirements:
119
- - - ">"
120
- - !ruby/object:Gem::Version
121
- version: 0.0.0
122
- version:
123
- - !ruby/object:Gem::Dependency
124
- name: highline
125
- version_requirement:
126
- version_requirements: !ruby/object:Gem::Version::Requirement
127
- requirements:
128
- - - ">="
129
- - !ruby/object:Gem::Version
130
- version: 1.4.0
131
- version:
115
+ rubyforge_project: copiousfreetime
116
+ rubygems_version: 1.3.1
117
+ signing_key:
118
+ specification_version: 2
119
+ summary: HTAuth is a pure ruby replacement for the Apache support programs htdigest and htpasswd
120
+ test_files: []
121
+
@@ -1,53 +0,0 @@
1
- require 'rubygems'
2
- require 'htauth/specification'
3
- require 'htauth/version'
4
- require 'rake'
5
-
6
- # The Gem Specification plus some extras for htauth.
7
- module HTAuth
8
- SPEC = HTAuth::Specification.new do |spec|
9
- spec.name = "htauth"
10
- spec.version = HTAuth::VERSION
11
- spec.rubyforge_project = "copiousfreetime"
12
- spec.author = "Jeremy Hinegardner"
13
- spec.email = "jeremy@hinegardner.org"
14
- spec.homepage = "http://copiousfreetime.rubyforge.org/htauth"
15
-
16
- spec.summary = "HTAuth provides htdigest and htpasswd support."
17
- spec.description = <<-DESC
18
- HTAuth is a pure ruby replacement for the Apache support programs htdigest
19
- and htpasswd. Command line and API access are provided for access to
20
- htdigest and htpasswd files.
21
- DESC
22
-
23
- spec.extra_rdoc_files = FileList["CHANGES", "LICENSE", "README"]
24
- spec.has_rdoc = true
25
- spec.rdoc_main = "README"
26
- spec.rdoc_options = [ "--line-numbers" , "--inline-source" ]
27
-
28
- spec.test_files = FileList["spec/**/*"]
29
- spec.executables << "htdigest-ruby"
30
- spec.executables << "htpasswd-ruby"
31
- spec.files = spec.test_files + spec.extra_rdoc_files +
32
- FileList["lib/**/*.rb"]
33
-
34
- spec.add_dependency("rake")
35
- spec.add_dependency("highline", ">= 1.4.0")
36
-
37
- spec.platform = Gem::Platform::RUBY
38
-
39
- spec.remote_user = "jjh"
40
- spec.local_rdoc_dir = "doc/rdoc"
41
- spec.remote_rdoc_dir = ""
42
- spec.local_coverage_dir = "doc/coverage"
43
-
44
- spec.remote_site_dir = "#{spec.name}/"
45
-
46
- spec.post_install_message = <<EOM
47
- Try out 'htpasswd-ruby' or 'htdigest-ruby' to get started.
48
- EOM
49
-
50
- end
51
- end
52
-
53
-
@@ -1,129 +0,0 @@
1
- require 'rubygems'
2
- require 'rubygems/specification'
3
- require 'rake'
4
- require 'htauth'
5
-
6
- module HTAuth
7
- # Add some additional items to Gem::Specification
8
- # A HTAuth::Specification adds additional pieces of information the
9
- # typical gem specification
10
- class Specification
11
-
12
- RUBYFORGE_ROOT = "/var/www/gforge-projects/"
13
-
14
- # user that accesses remote site
15
- attr_accessor :remote_user
16
-
17
- # remote host, default 'rubyforge.org'
18
- attr_accessor :remote_host
19
-
20
- # name the rdoc main
21
- attr_accessor :rdoc_main
22
-
23
- # local directory in development holding the generated rdoc
24
- # default 'doc'
25
- attr_accessor :local_rdoc_dir
26
-
27
- # remote directory for storing rdoc, default 'doc'
28
- attr_accessor :remote_rdoc_dir
29
-
30
- # local directory for coverage report
31
- attr_accessor :local_coverage_dir
32
-
33
- # remote directory for storing coverage reports
34
- # This defaults to 'coverage'
35
- attr_accessor :remote_coverage_dir
36
-
37
- # local directory for generated website, default +site/public+
38
- attr_accessor :local_site_dir
39
-
40
- # remote directory relative to +remote_root+ for the website.
41
- # website.
42
- attr_accessor :remote_site_dir
43
-
44
- # is a .tgz to be created?, default 'true'
45
- attr_accessor :need_tar
46
-
47
- # is a .zip to be created, default 'true'
48
- attr_accessor :need_zip
49
-
50
-
51
- def initialize
52
- @remote_user = nil
53
- @remote_host = "rubyforge.org"
54
-
55
- @rdoc_main = "README"
56
- @local_rdoc_dir = "doc"
57
- @remote_rdoc_dir = "doc"
58
- @local_coverage_dir = "coverage"
59
- @remote_coverage_dir = "coverage"
60
- @local_site_dir = "site/public"
61
- @remote_site_dir = "."
62
-
63
- @need_tar = true
64
- @need_zip = true
65
-
66
- @spec = Gem::Specification.new
67
-
68
- yield self if block_given?
69
-
70
- # update rdoc options to take care of the rdoc_main if it is
71
- # there, and add a default title if one is not given
72
- if not @spec.rdoc_options.include?("--main") then
73
- @spec.rdoc_options.concat(["--main", rdoc_main])
74
- end
75
-
76
- if not @spec.rdoc_options.include?("--title") then
77
- @spec.rdoc_options.concat(["--title","'#{name} -- #{summary}'"])
78
- end
79
- end
80
-
81
- # if this gets set then it overwrites what would be the
82
- # rubyforge default. If rubyforge project is not set then use
83
- # name. If rubyforge project and name are set, but they are
84
- # different then assume that name is a subproject of the
85
- # rubyforge project
86
- def remote_root
87
- if rubyforge_project.nil? or
88
- rubyforge_project == name then
89
- return RUBYFORGE_ROOT + "#{name}/"
90
- else
91
- return RUBYFORGE_ROOT + "#{rubyforge_project}/#{name}/"
92
- end
93
- end
94
-
95
- # rdoc files is the same as what would be generated during gem
96
- # installation. That is, everything in the require paths plus
97
- # the rdoc_extra_files
98
- #
99
- def rdoc_files
100
- flist = extra_rdoc_files.dup
101
- @spec.require_paths.each do |rp|
102
- flist << FileList["#{rp}/**/*.rb"]
103
- end
104
- flist.flatten.uniq
105
- end
106
-
107
- # calculate the remote directories
108
- def remote_root_location
109
- "#{remote_user}@#{remote_host}:#{remote_root}"
110
- end
111
-
112
- def remote_rdoc_location
113
- remote_root_location + @remote_rdoc_dir
114
- end
115
-
116
- def remote_coverage_location
117
- remote_root_loation + @remote_coverage_dir
118
- end
119
-
120
- def remote_site_location
121
- remote_root_location + @remote_site_dir
122
- end
123
-
124
- # we delegate any other calls to spec
125
- def method_missing(method_id,*params,&block)
126
- @spec.send method_id, *params, &block
127
- end
128
- end
129
- end