simple_document 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -72,7 +72,7 @@ class SimpleDocument
72
72
  private
73
73
 
74
74
  def parse_name(name)
75
- if name =~ /^([-a-zA-Z0-9]+)\/([-a-zA-Z0-9]+)$/
75
+ if name =~ /^([A-Za-z][-a-zA-Z0-9_]*)\/([A-Za-z][-a-zA-Z0-9_]*)$/
76
76
  return [$1, $2]
77
77
  end
78
78
 
@@ -0,0 +1,71 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "simple_document"
8
+ s.version = "0.1.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["radiospiel"]
12
+ s.date = "2012-04-25"
13
+ s.description = "Simplistic documents."
14
+ s.email = "eno@open-lab.org"
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ "Gemfile",
21
+ "Gemfile.lock",
22
+ "LICENSE.txt",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "lib/abstract_method.rb",
27
+ "lib/simple_document.rb",
28
+ "lib/simple_document/file_store.rb",
29
+ "lib/simple_document/ostruct.rb",
30
+ "simple_document.gemspec",
31
+ "test/file_store_test.rb",
32
+ "test/fixtures/folder/about.de.md",
33
+ "test/fixtures/folder/about.md",
34
+ "test/fixtures/folder/headered.md",
35
+ "test/name_validation_test.rb",
36
+ "test/test_helper.rb"
37
+ ]
38
+ s.homepage = "http://github.com/radiospiel/simple_document"
39
+ s.licenses = ["MIT"]
40
+ s.require_paths = ["lib"]
41
+ s.rubygems_version = "1.8.10"
42
+ s.summary = "Need some kind of document? Just throw me in."
43
+
44
+ if s.respond_to? :specification_version then
45
+ s.specification_version = 3
46
+
47
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
48
+ s.add_development_dependency(%q<bundler>, [">= 0"])
49
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
50
+ s.add_development_dependency(%q<simplecov>, [">= 0"])
51
+ s.add_development_dependency(%q<ruby-debug19>, [">= 0"])
52
+ s.add_development_dependency(%q<timecop>, [">= 0"])
53
+ s.add_development_dependency(%q<redis>, [">= 0"])
54
+ else
55
+ s.add_dependency(%q<bundler>, [">= 0"])
56
+ s.add_dependency(%q<jeweler>, [">= 0"])
57
+ s.add_dependency(%q<simplecov>, [">= 0"])
58
+ s.add_dependency(%q<ruby-debug19>, [">= 0"])
59
+ s.add_dependency(%q<timecop>, [">= 0"])
60
+ s.add_dependency(%q<redis>, [">= 0"])
61
+ end
62
+ else
63
+ s.add_dependency(%q<bundler>, [">= 0"])
64
+ s.add_dependency(%q<jeweler>, [">= 0"])
65
+ s.add_dependency(%q<simplecov>, [">= 0"])
66
+ s.add_dependency(%q<ruby-debug19>, [">= 0"])
67
+ s.add_dependency(%q<timecop>, [">= 0"])
68
+ s.add_dependency(%q<redis>, [">= 0"])
69
+ end
70
+ end
71
+
@@ -0,0 +1,21 @@
1
+ require_relative 'test_helper'
2
+
3
+ DIR = File.expand_path File.dirname(__FILE__)
4
+
5
+ class NameValidationTest < Test::Unit::TestCase
6
+ def parse(name)
7
+ SimpleDocument.send(:parse_name, name)
8
+ end
9
+
10
+ def test_parse_name
11
+ assert_equal %w(abc def), parse("abc/def")
12
+ assert_equal %w(fuu b_r), parse("fuu/b_r")
13
+ assert_equal %w(f-u bar), parse("f-u/bar")
14
+
15
+ assert_raise(ArgumentError) { parse("x") }
16
+ assert_raise(ArgumentError) { parse("09-/def") } # starts with a digit
17
+ assert_raise(ArgumentError) { parse("/x") } # doesn't have two parts
18
+ assert_raise(ArgumentError) { parse("/a/b/x") } # more than two parts
19
+ assert_raise(ArgumentError) { parse("fuu/b_r.x") } # contains a dot
20
+ end
21
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_document
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-04-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
- requirement: &70336244947520 !ruby/object:Gem::Requirement
16
+ requirement: &70277088740700 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70336244947520
24
+ version_requirements: *70277088740700
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: jeweler
27
- requirement: &70336244946980 !ruby/object:Gem::Requirement
27
+ requirement: &70277088740000 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70336244946980
35
+ version_requirements: *70277088740000
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: simplecov
38
- requirement: &70336244946360 !ruby/object:Gem::Requirement
38
+ requirement: &70277088739300 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70336244946360
46
+ version_requirements: *70277088739300
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: ruby-debug19
49
- requirement: &70336244940120 !ruby/object:Gem::Requirement
49
+ requirement: &70277088738640 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70336244940120
57
+ version_requirements: *70277088738640
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: timecop
60
- requirement: &70336244939540 !ruby/object:Gem::Requirement
60
+ requirement: &70277088738020 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70336244939540
68
+ version_requirements: *70277088738020
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: redis
71
- requirement: &70336244938900 !ruby/object:Gem::Requirement
71
+ requirement: &70277088737360 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70336244938900
79
+ version_requirements: *70277088737360
80
80
  description: Simplistic documents.
81
81
  email: eno@open-lab.org
82
82
  executables: []
@@ -95,10 +95,12 @@ files:
95
95
  - lib/simple_document.rb
96
96
  - lib/simple_document/file_store.rb
97
97
  - lib/simple_document/ostruct.rb
98
+ - simple_document.gemspec
98
99
  - test/file_store_test.rb
99
100
  - test/fixtures/folder/about.de.md
100
101
  - test/fixtures/folder/about.md
101
102
  - test/fixtures/folder/headered.md
103
+ - test/name_validation_test.rb
102
104
  - test/test_helper.rb
103
105
  homepage: http://github.com/radiospiel/simple_document
104
106
  licenses:
@@ -115,7 +117,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
117
  version: '0'
116
118
  segments:
117
119
  - 0
118
- hash: 2569138236874985957
120
+ hash: 1136988805773102884
119
121
  required_rubygems_version: !ruby/object:Gem::Requirement
120
122
  none: false
121
123
  requirements: