namaste 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,43 @@
1
+ # rcov generated
2
+ coverage
3
+
4
+ # rdoc generated
5
+ rdoc
6
+
7
+ # yard generated
8
+ doc
9
+ .yardoc
10
+
11
+ # bundler
12
+ .bundle
13
+
14
+ # jeweler generated
15
+ pkg
16
+
17
+ Gemfile.lock
18
+ # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
19
+ #
20
+ # * Create a file at ~/.gitignore
21
+ # * Include files you want ignored
22
+ # * Run: git config --global core.excludesfile ~/.gitignore
23
+ #
24
+ # After doing this, these files will be ignored in all your git projects,
25
+ # saving you from having to 'pollute' every project you touch with them
26
+ #
27
+ # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
28
+ #
29
+ # For MacOS:
30
+ #
31
+ #.DS_Store
32
+ #
33
+ # For TextMate
34
+ #*.tmproj
35
+ #tmtags
36
+ #
37
+ # For emacs:
38
+ #*~
39
+ #\#*
40
+ #.\#*
41
+ #
42
+ # For vim:
43
+ #*.swp
data/Gemfile CHANGED
@@ -1,15 +1,2 @@
1
1
  source "http://rubygems.org"
2
- # Add dependencies required to use your gem here.
3
- # Example:
4
- # gem "activesupport", ">= 2.3.5"
5
-
6
- gem "i18n"
7
-
8
- # Add dependencies to develop your gem here.
9
- # Include everything needed to run rake, tests, features, etc.
10
- group :development do
11
- gem "shoulda", ">= 0"
12
- gem "bundler", "~> 1.0.0"
13
- gem "jeweler", "~> 1.5.1"
14
- gem "rcov", ">= 0"
15
- end
2
+ gemspec
data/LICENSE.txt CHANGED
@@ -1,20 +1,13 @@
1
- Copyright (c) 2010 Chris Beer
1
+ Copyright (c) 2011 Chris Beer
2
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:
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
10
6
 
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
7
+ http://www.apache.org/licenses/LICENSE-2.0
13
8
 
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
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
@@ -14,6 +14,6 @@ A ruby client implementation of the [[Namaste|http://www.cdlib.org/inside/diglib
14
14
 
15
15
  == Copyright
16
16
 
17
- Copyright (c) 2010 Chris Beer. See LICENSE.txt for
17
+ Copyright (c) 2011 Chris Beer. See LICENSE.txt for
18
18
  further details.
19
19
 
data/Rakefile CHANGED
@@ -1,5 +1,7 @@
1
+ require 'rake'
1
2
  require 'rubygems'
2
3
  require 'bundler'
4
+ require 'rspec/core/rake_task'
3
5
  begin
4
6
  Bundler.setup(:default, :development)
5
7
  rescue Bundler::BundlerError => e
@@ -7,41 +9,35 @@ rescue Bundler::BundlerError => e
7
9
  $stderr.puts "Run `bundle install` to install missing gems"
8
10
  exit e.status_code
9
11
  end
10
- require 'rake'
11
-
12
- require 'jeweler'
13
- Jeweler::Tasks.new do |gem|
14
- gem.name = "namaste"
15
- gem.homepage = "http://github.com/cbeer/namaste"
16
- gem.license = "MIT"
17
- gem.summary = "A ruby client implementation of the Namaste specification for directory description with filename-based tags."
18
- gem.email = "chris@cbeer.info"
19
- gem.authors = ["Chris Beer"]
20
- end
21
- Jeweler::RubygemsDotOrgTasks.new
22
12
 
23
- require 'rake/testtask'
24
- Rake::TestTask.new(:test) do |test|
25
- test.libs << 'lib' << 'test'
26
- test.pattern = 'test/**/test_*.rb'
27
- test.verbose = true
28
- end
29
-
30
- require 'rcov/rcovtask'
31
- Rcov::RcovTask.new do |test|
32
- test.libs << 'test'
33
- test.pattern = 'test/**/test_*.rb'
34
- test.verbose = true
35
- end
13
+ Bundler::GemHelper.install_tasks
36
14
 
37
- task :default => :test
15
+ namespace :namaste do
16
+ RSpec::Core::RakeTask.new(:rspec) do |t|
17
+ t.pattern = "./spec/**/*_spec.rb"
18
+ t.rcov = true
19
+ t.rcov_opts = ["--exclude", "gems\/,spec\/"]
20
+ end
38
21
 
39
- require 'rake/rdoctask'
40
- Rake::RDocTask.new do |rdoc|
41
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
22
+ # Use yard to build docs
23
+ begin
24
+ require 'yard'
25
+ require 'yard/rake/yardoc_task'
26
+ project_root = File.expand_path("#{File.dirname(__FILE__)}")
27
+ doc_destination = File.join(project_root, 'doc')
42
28
 
43
- rdoc.rdoc_dir = 'rdoc'
44
- rdoc.title = "namaste #{version}"
45
- rdoc.rdoc_files.include('README*')
46
- rdoc.rdoc_files.include('lib/**/*.rb')
29
+ YARD::Rake::YardocTask.new(:doc) do |yt|
30
+ yt.files = Dir.glob(File.join(project_root, 'lib', '**', '*.rb')) +
31
+ [ File.join(project_root, 'README.textile') ]
32
+ yt.options = ['--output-dir', doc_destination, '--readme', 'README.textile']
33
+ end
34
+ rescue LoadError
35
+ desc "Generate YARD Documentation"
36
+ task :doc do
37
+ abort "Please install the YARD gem to generate rdoc."
38
+ end
39
+ end
47
40
  end
41
+
42
+ desc "Run the rspec tests, aggregate coverage data, and build the Yard docs"
43
+ task :hudson => ["namaste:rspec","namaste:doc"]
data/bin/namaste CHANGED
File without changes
data/lib/namaste.rb CHANGED
@@ -1,34 +1,71 @@
1
1
  require 'i18n'
2
+ # The Namaste module conains a Mixin module to include into a class.
3
+
4
+ # class MyNamaste
5
+ # include Namaste::Mixin
6
+ # end
7
+ # MyNamaste.new
8
+ # MyNamaste.who = "John Doe"
9
+ # MyNamaste.what = "John's Manifesto"
10
+
2
11
  module Namaste
12
+ # @return [Hash] of Namaste mappings for integer and type value
3
13
  DUBLIN_KERNEL = { :type => 0, :who => 1, :what => 2, :when => 3, :where => 4 }
14
+
15
+ # @return [Hash] of regular expressions matching the Namaste::DUBLIN_KERNAL Hash
4
16
  PATTERN = Hash[*Namaste::DUBLIN_KERNEL.map { |k, v| [k, Regexp.new("^#{v}=.*")]}.flatten]
17
+
18
+ # @return [Regexp] of standard Namaste file name pattern
5
19
  PATTERN_CORE = /^\d=.*/
20
+
21
+ # @return [Regexp] of the possible exteneded Namaste file name pattern
6
22
  PATTERN_EXTENDED = /=.*/
23
+
7
24
  module Mixin
25
+ # When this Mixin module is included this will define getters and setters on your class for each of the keys in Namaste::DUBLIN_KERNAL.
8
26
  def self.included base
9
27
  Namaste::DUBLIN_KERNEL.each do |k,v|
10
28
  base.class_eval do
11
- define_method(k.to_s) do |*args|
29
+ define_method(k.to_s) do |*args|
12
30
  namaste(:filter => k)
13
- end
31
+ end
14
32
 
15
- define_method(k.to_s+'=') do |*args|
16
- set_namaste v, *args
17
- end
18
- end
33
+ define_method(k.to_s+'=') do |*args|
34
+ set_namaste v, *args
35
+ end
36
+ end
19
37
  end
20
38
  end
39
+
40
+ # Return the file contents of a Namaste given a filter and regexp
41
+ # @param [Hash] an arguments hash that accepts filter, extended, and regex arguments
42
+ # @return [String] the contents of the Namaste
43
+ def namaste args = {}
44
+ namaste_tags(args).map { |x| get_namaste x }
45
+ end
46
+
47
+ # @return [Hash] with the Dflat info broken out into its individual components of type, name, major, and minor.
48
+ def dirtype
49
+ namaste(:filter => :type).map do |nam|
50
+ matches = /([^_]+)[|\/](\d+)\.(\d+)/.match(nam[:value])
51
+ { :type => nam[:value], :name => matches[1], :major => matches[2], :minor => matches[3] } if matches
52
+ end
53
+ end
54
+
55
+ private
21
56
 
57
+ # Get an array of namaste tags that match the filter and regex provided.
58
+ # @param [Hash] an arguments hash that accepts filter, extended, and regex arguments
59
+ # @return [Array] an array of Namaste tags
22
60
  def namaste_tags args = {}
23
- tags = []
24
61
  rgx = nil
25
62
 
26
63
  if args[:filter]
27
- if Namaste::PATTERN.key? args[:filter].to_sym
64
+ if Namaste::PATTERN.key? args[:filter].to_sym
28
65
  rgx = Namaste::PATTERN[args[:filter].to_sym]
29
- else
66
+ else
30
67
  rgx = Regexp.new("^#{args[:filter]}=.*")
31
- end
68
+ end
32
69
  else
33
70
  rgx = Namaste::PATTERN_CORE
34
71
  rgx = Regexp(rgx, Namaste::PATTERN_EXTENDED) if args[:extended]
@@ -36,21 +73,9 @@ module Namaste
36
73
 
37
74
  rgx = args[:regex] if args[:regex]
38
75
 
39
- tags |= self.select { |x| x =~ rgx }
76
+ self.select { |x| x =~ rgx }
40
77
  end
41
-
42
- def namaste args = {}
43
- namaste_tags(args).map { |x| get_namaste x }
44
- end
45
-
46
- def dirtype
47
- namaste(:filter => :type).map do |nam|
48
- matches = /([^_]+)_(\d+)\.(\d+)/.match(nam[:value])
49
- { :type => nam[:value], :name => matches[1], :major => matches[2], :minor => matches[3] } if matches
50
- end
51
- end
52
-
53
- private
78
+
54
79
  def set_namaste tag, value
55
80
  File.open(File.join(self.path, make_namaste(tag, value)), 'w') do |f|
56
81
  f.write(value)
@@ -81,6 +106,7 @@ module Namaste
81
106
  end
82
107
 
83
108
  class Dir < ::Dir
84
- include Namaste::Mixin
109
+ include Namaste::Mixin
85
110
  end
111
+
86
112
  end
@@ -0,0 +1,3 @@
1
+ module Namaste
2
+ VERSION = "0.2.0"
3
+ end
data/namaste.gemspec ADDED
@@ -0,0 +1,36 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "namaste/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "namaste"
7
+ s.version = Namaste::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Chris Beer"]
10
+ s.email = %q{chris@cbeer.info}
11
+ s.homepage = "http://github.com/microservices/namaste"
12
+ s.summary = %q{A ruby client implementation of the Namaste specification for directory description with filename-based tags.}
13
+ s.description = %q{A ruby client implementation of the Namaste specification for directory description with filename-based tags. [https://wiki.ucop.edu/display/Curation/Namaste]}
14
+
15
+ s.files = `git ls-files`.split("\n")
16
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
+ s.default_executable = %q{namaste}
19
+ s.require_paths = ["lib"]
20
+
21
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
22
+
23
+ s.licenses = ["Apache2"]
24
+
25
+ s.rubygems_version = %q{1.3.7}
26
+
27
+ s.add_dependency("i18n")
28
+ s.add_development_dependency("rake")
29
+ s.add_development_dependency("rcov")
30
+ s.add_development_dependency("bundler", "~>1.0.0")
31
+ s.add_development_dependency("rspec", ">2.0.0")
32
+ s.add_development_dependency("yard")
33
+ s.add_development_dependency("RedCloth")
34
+
35
+ end
36
+
@@ -0,0 +1,125 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ class TestNamasteSurrogate
4
+ include Namaste::Mixin
5
+
6
+ def test_make_namaste tag, value
7
+ make_namaste tag, value
8
+ end
9
+
10
+ end
11
+ describe Namaste do
12
+ before(:all) do
13
+ @namaste = TestNamasteSurrogate.new
14
+ end
15
+ describe "make_namaste" do
16
+ it "should handle a simple value" do
17
+ @namaste.test_make_namaste(0, 'abcdef').should == "0=abcdef"
18
+ end
19
+ it "should properly handle dflat" do
20
+ @namaste.test_make_namaste(0, 'Dflat/0.19').should == "0=dflat_0.19"
21
+ end
22
+ it "should handle compled values correctly" do
23
+ @namaste.test_make_namaste(0, 'rQ@f2!éüAsd!').should == "0=rq_f2_euasd_"
24
+ end
25
+ it "should handle extended integers correctly" do
26
+ @namaste.test_make_namaste('x_123', 'extended').should == "x_123=extended"
27
+ end
28
+ it "should truncate file name at 255 characters" do
29
+ namaste = @namaste.test_make_namaste(0, 'lfvtshfasfogfzjgqokuwicivlnyluqlgfcsfmhtdbmrizvzqkiyaxqtlclkgxpgkmxtwwylepsorbdnddgrdgzpcyojqbwuxkqkfzmfbkxrfpaaymgygbpjgqxyklkfblqekgtrpdxvjsmodvkrlwcfrqswdknngervsjivehotqeiowigfpwymunrccgjhakdwpugwwtpqcpkwqvwlhcqccwqovlwaldwfuoalscdvzccgnpooedbrnttzmno')
30
+ namaste.length.should == 255
31
+ namaste.should == '0=lfvtshfasfogfzjgqokuwicivlnyluqlgfcsfmhtdbmrizvzqkiyaxqtlclkgxpgkmxtwwylepsorbdnddgrdgzpcyojqbwuxkqkfzmfbkxrfpaaymgygbpjgqxyklkfblqekgtrpdxvjsmodvkrlwcfrqswdknngervsjivehotqeiowigfpwymunrccgjhakdwpugwwtpqcpkwqvwlhcqccwqovlwaldwfuoalscdvzccgnpooedbrnt...'
32
+ end
33
+ end
34
+
35
+ describe "object instantiation" do
36
+ it "should define the appropriate setters and getters" do
37
+ d = Dir.mktmpdir
38
+ dir = Namaste::Dir.new(d)
39
+ dir.respond_to?(:type).should be_true
40
+ dir.respond_to?(:type=).should be_true
41
+ dir.respond_to?(:who).should be_true
42
+ dir.respond_to?(:who=).should be_true
43
+ dir.respond_to?(:what).should be_true
44
+ dir.respond_to?(:what=).should be_true
45
+ dir.respond_to?(:when).should be_true
46
+ dir.respond_to?(:when=).should be_true
47
+ dir.respond_to?(:where).should be_true
48
+ dir.respond_to?(:where=).should be_true
49
+ end
50
+ end
51
+ describe "namaste_tags" do
52
+ it "should handle normal filters correclty" do
53
+ Dir.mktmpdir do |d|
54
+ dir = Namaste::Dir.new(d)
55
+ File.open(File.join(dir.path,"1=last,first"),"w") do |f|
56
+ f.write("Last,First")
57
+ end
58
+ dir.send(:namaste_tags,{:filter=>"1"}).include?("1=last,first").should be_true
59
+ end
60
+ end
61
+ it "should take regular expressions correctly" do
62
+ Dir.mktmpdir do |d|
63
+ dir = Namaste::Dir.new(d)
64
+ File.open(File.join(dir.path,"1=last,first"),"w") do |f|
65
+ f.write("Last,First")
66
+ end
67
+ dir.send(:namaste_tags,{:regex=>/last,first/}).include?("1=last,first").should be_true
68
+ end
69
+ end
70
+ it "should take a number as a regexp and handle it correclty" do
71
+ Dir.mktmpdir do |d|
72
+ dir = Namaste::Dir.new(d)
73
+ File.open(File.join(dir.path,"1=last,first"),"w") do |f|
74
+ f.write("Last,First")
75
+ end
76
+ dir.send(:namaste_tags,{:filter=>:who}).include?("1=last,first").should be_true
77
+ end
78
+ end
79
+ end
80
+
81
+ describe "get_namaste" do
82
+ it "should reterive the appriprate tag" do
83
+ Dir.mktmpdir do |d|
84
+ dir = Namaste::Dir.new(d)
85
+ File.open(File.join(dir.path,"1=last,first"),"w") do |f|
86
+ f.write("Last,First")
87
+ end
88
+ data = dir.send(:get_namaste,"1=last,first")
89
+ data.has_key?(:value).should be_true and
90
+ data[:value].should == "Last,First"
91
+
92
+ data.has_key?(:file).should be_true and
93
+ data[:file].should == "1=last,first"
94
+
95
+ data.has_key?(:name).should be_true and
96
+ data[:name].should == "1"
97
+ end
98
+ end
99
+ end
100
+
101
+ describe "dirtype" do
102
+ it "should parse out the Dflat type properly" do
103
+ Dir.mktmpdir do |d|
104
+ dir = Namaste::Dir.new(d)
105
+ File.open(File.join(dir.path,"0=dflat_0.19"),"w") do |f|
106
+ f.write("Dflat/0.19")
107
+ end
108
+ dir.dirtype.length == 1
109
+
110
+ dir.dirtype.first.has_key?(:name).should be_true and
111
+ dir.dirtype.first[:name].should == "Dflat"
112
+
113
+ dir.dirtype.first.has_key?(:minor).should be_true and
114
+ dir.dirtype.first[:minor].should == "19"
115
+
116
+ dir.dirtype.first.has_key?(:type).should be_true and
117
+ dir.dirtype.first[:type].should == "Dflat/0.19"
118
+
119
+ dir.dirtype.first.has_key?(:major).should be_true and
120
+ dir.dirtype.first[:major].should == "0"
121
+ end
122
+ end
123
+ end
124
+
125
+ end
@@ -0,0 +1,3 @@
1
+ require "rspec"
2
+ require "namaste"
3
+ require "tmpdir"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: namaste
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease: false
4
+ hash: 23
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 0.1.0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Chris Beer
@@ -15,14 +15,13 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-26 00:00:00 -05:00
18
+ date: 2011-06-09 00:00:00 -05:00
19
19
  default_executable: namaste
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- type: :runtime
23
- prerelease: false
24
22
  name: i18n
25
- version_requirements: &id001 !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
26
25
  none: false
27
26
  requirements:
28
27
  - - ">="
@@ -31,12 +30,12 @@ dependencies:
31
30
  segments:
32
31
  - 0
33
32
  version: "0"
34
- requirement: *id001
33
+ type: :runtime
34
+ version_requirements: *id001
35
35
  - !ruby/object:Gem::Dependency
36
- type: :development
36
+ name: rake
37
37
  prerelease: false
38
- name: shoulda
39
- version_requirements: &id002 !ruby/object:Gem::Requirement
38
+ requirement: &id002 !ruby/object:Gem::Requirement
40
39
  none: false
41
40
  requirements:
42
41
  - - ">="
@@ -45,12 +44,26 @@ dependencies:
45
44
  segments:
46
45
  - 0
47
46
  version: "0"
48
- requirement: *id002
49
- - !ruby/object:Gem::Dependency
50
47
  type: :development
48
+ version_requirements: *id002
49
+ - !ruby/object:Gem::Dependency
50
+ name: rcov
51
51
  prerelease: false
52
+ requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 0
60
+ version: "0"
61
+ type: :development
62
+ version_requirements: *id003
63
+ - !ruby/object:Gem::Dependency
52
64
  name: bundler
53
- version_requirements: &id003 !ruby/object:Gem::Requirement
65
+ prerelease: false
66
+ requirement: &id004 !ruby/object:Gem::Requirement
54
67
  none: false
55
68
  requirements:
56
69
  - - ~>
@@ -61,28 +74,42 @@ dependencies:
61
74
  - 0
62
75
  - 0
63
76
  version: 1.0.0
64
- requirement: *id003
65
- - !ruby/object:Gem::Dependency
66
77
  type: :development
78
+ version_requirements: *id004
79
+ - !ruby/object:Gem::Dependency
80
+ name: rspec
67
81
  prerelease: false
68
- name: jeweler
69
- version_requirements: &id004 !ruby/object:Gem::Requirement
82
+ requirement: &id005 !ruby/object:Gem::Requirement
70
83
  none: false
71
84
  requirements:
72
- - - ~>
85
+ - - ">"
73
86
  - !ruby/object:Gem::Version
74
- hash: 1
87
+ hash: 15
75
88
  segments:
76
- - 1
77
- - 5
78
- - 1
79
- version: 1.5.1
80
- requirement: *id004
89
+ - 2
90
+ - 0
91
+ - 0
92
+ version: 2.0.0
93
+ type: :development
94
+ version_requirements: *id005
81
95
  - !ruby/object:Gem::Dependency
96
+ name: yard
97
+ prerelease: false
98
+ requirement: &id006 !ruby/object:Gem::Requirement
99
+ none: false
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ hash: 3
104
+ segments:
105
+ - 0
106
+ version: "0"
82
107
  type: :development
108
+ version_requirements: *id006
109
+ - !ruby/object:Gem::Dependency
110
+ name: RedCloth
83
111
  prerelease: false
84
- name: rcov
85
- version_requirements: &id005 !ruby/object:Gem::Requirement
112
+ requirement: &id007 !ruby/object:Gem::Requirement
86
113
  none: false
87
114
  requirements:
88
115
  - - ">="
@@ -91,32 +118,33 @@ dependencies:
91
118
  segments:
92
119
  - 0
93
120
  version: "0"
94
- requirement: *id005
95
- description:
121
+ type: :development
122
+ version_requirements: *id007
123
+ description: A ruby client implementation of the Namaste specification for directory description with filename-based tags. [https://wiki.ucop.edu/display/Curation/Namaste]
96
124
  email: chris@cbeer.info
97
125
  executables:
98
126
  - namaste
99
127
  extensions: []
100
128
 
101
- extra_rdoc_files:
102
- - LICENSE.txt
103
- - README.rdoc
129
+ extra_rdoc_files: []
130
+
104
131
  files:
105
132
  - .document
133
+ - .gitignore
106
134
  - Gemfile
107
- - Gemfile.lock
108
135
  - LICENSE.txt
109
- - README.rdoc
136
+ - README.textile
110
137
  - Rakefile
111
- - VERSION
112
138
  - bin/namaste
113
139
  - lib/namaste.rb
114
- - test/helper.rb
115
- - test/test_namaste.rb
140
+ - lib/namaste/version.rb
141
+ - namaste.gemspec
142
+ - spec/lib/namaste_spec.rb
143
+ - spec/spec_helper.rb
116
144
  has_rdoc: true
117
- homepage: http://github.com/cbeer/namaste
145
+ homepage: http://github.com/microservices/namaste
118
146
  licenses:
119
- - MIT
147
+ - Apache2
120
148
  post_install_message:
121
149
  rdoc_options: []
122
150
 
@@ -143,10 +171,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
171
  requirements: []
144
172
 
145
173
  rubyforge_project:
146
- rubygems_version: 1.3.7
174
+ rubygems_version: 1.6.2
147
175
  signing_key:
148
176
  specification_version: 3
149
177
  summary: A ruby client implementation of the Namaste specification for directory description with filename-based tags.
150
178
  test_files:
151
- - test/helper.rb
152
- - test/test_namaste.rb
179
+ - spec/lib/namaste_spec.rb
180
+ - spec/spec_helper.rb
data/Gemfile.lock DELETED
@@ -1,22 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- git (1.2.5)
5
- i18n (0.4.1)
6
- jeweler (1.5.1)
7
- bundler (~> 1.0.0)
8
- git (>= 1.2.5)
9
- rake
10
- rake (0.8.7)
11
- rcov (0.9.9)
12
- shoulda (2.11.3)
13
-
14
- PLATFORMS
15
- ruby
16
-
17
- DEPENDENCIES
18
- bundler (~> 1.0.0)
19
- i18n
20
- jeweler (~> 1.5.1)
21
- rcov
22
- shoulda
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.1.0
data/test/helper.rb DELETED
@@ -1,18 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- begin
4
- Bundler.setup(:default, :development)
5
- rescue Bundler::BundlerError => e
6
- $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
8
- exit e.status_code
9
- end
10
- require 'test/unit'
11
- require 'shoulda'
12
-
13
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
- $LOAD_PATH.unshift(File.dirname(__FILE__))
15
- require 'namaste'
16
-
17
- class Test::Unit::TestCase
18
- end
data/test/test_namaste.rb DELETED
@@ -1,35 +0,0 @@
1
- require 'helper'
2
-
3
- class TestNamasteSurrogate
4
- include Namaste::Mixin
5
-
6
- def test_make_namaste tag, value
7
- make_namaste tag, value
8
- end
9
- end
10
- class TestNamaste < Test::Unit::TestCase
11
- def test_make_simple
12
- t = TestNamasteSurrogate.new
13
- assert_equal(t.test_make_namaste(0, 'abcdef'), '0=abcdef')
14
- end
15
-
16
- def test_make_dflat
17
- t = TestNamasteSurrogate.new
18
- assert_equal(t.test_make_namaste(0, 'Dflat/0.19'), '0=dflat_0.19')
19
- end
20
-
21
- def test_make_complex
22
- t = TestNamasteSurrogate.new
23
- assert_equal(t.test_make_namaste(0, 'rQ@f2!éüAsd!'), '0=rq_f2_euasd_')
24
- end
25
-
26
- def test_make_extended
27
- t = TestNamasteSurrogate.new
28
- assert_equal(t.test_make_namaste('x_123', 'extended'), 'x_123=extended')
29
- end
30
-
31
- def test_truncate
32
- t = TestNamasteSurrogate.new
33
- assert_equal(t.test_make_namaste(0, 'lfvtshfasfogfzjgqokuwicivlnyluqlgfcsfmhtdbmrizvzqkiyaxqtlclkgxpgkmxtwwylepsorbdnddgrdgzpcyojqbwuxkqkfzmfbkxrfpaaymgygbpjgqxyklkfblqekgtrpdxvjsmodvkrlwcfrqswdknngervsjivehotqeiowigfpwymunrccgjhakdwpugwwtpqcpkwqvwlhcqccwqovlwaldwfuoalscdvzccgnpooedbrnttzmno'), '0=lfvtshfasfogfzjgqokuwicivlnyluqlgfcsfmhtdbmrizvzqkiyaxqtlclkgxpgkmxtwwylepsorbdnddgrdgzpcyojqbwuxkqkfzmfbkxrfpaaymgygbpjgqxyklkfblqekgtrpdxvjsmodvkrlwcfrqswdknngervsjivehotqeiowigfpwymunrccgjhakdwpugwwtpqcpkwqvwlhcqccwqovlwaldwfuoalscdvzccgnpooedbrnt...')
34
- end
35
- end