middleman-ya_lorem_ja 0.0.4 → 0.0.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d98eef68c1d13f0e6b77bf0b562350f80c3c5dd
4
- data.tar.gz: a321eb59f37f5fca918d9d94acf74cd2cd082838
3
+ metadata.gz: 78c5154189946790ac8556de5fb98eaf528f68c2
4
+ data.tar.gz: d63e33f31aa7ea6af0719023eae942516de189f5
5
5
  SHA512:
6
- metadata.gz: e12af62faa5f3ad66ac969a441c65a6d243bd203abf6516230764af4168644ec59943e58cb0c1d19e7ee19594b1bc0c77614030538bcf2921123278cd5de1cbd
7
- data.tar.gz: b59b604b4a17d296b414eccd44e66b4a80b696a5301b7cd973dde21ba5cffd6e292ed9b8edfd8544e3dbdaba98b81c1b75fa69045a488031a613edf790f05915
6
+ metadata.gz: 2e9756734abb797dd8446667c6e50cfe06f9697efab0bd07c52371654df49de27ea60759b28eda24d361504f7b5d1c1080fea3071388fe4b060240100036a080
7
+ data.tar.gz: 42585321d0f19591b0a04923a943fc492d3d9fff56c3fcc7a3da65182ea3ff4d5a15d7523e6d46d8b9b45c51419cf46541ffe7490d84de5b1feff942041ea8b5
@@ -1,19 +1,17 @@
1
1
  Feature: Lorem generating helper
2
-
3
2
  Scenario: Lorem Helper
4
3
  Given the Server is running at "test-app"
5
4
  Then going to "/word.html" should not raise an exception
6
5
  Then I should see "#word" contents have over "2" chars
7
6
  Then I should see "#words5" contents have over "10" chars
8
7
  Then I should see "#sentence" contents have over "#{2*6}" chars
9
- Then I should see "#sentence" contents have "1" sentences
8
+ Then I should see "#sentence" contents have "1" sentences
10
9
  Then I should see "#sentences3" contents have over "6" chars
11
10
  Then I should see "#sentences3" contents have "3" sentences
12
11
  Then I should see "#paragraph" contents have "1" paragraphs
13
12
  Then I should see "#paragraph" contents match "</p>"
14
13
  Then I should see "#paragraphs3" contents have "3" paragraphs
15
- Then I should see "#paragraphs3" contents match "</p>"
16
- Then I should see "#date" contents match "\d{4}年\d{2}月\d{2}日"
14
+ Then I should see "#paragraphs3" contents match "</p>"
15
+ Then I should see "#date" contents match "\d{4}年\d{2}月\d{2}日"
17
16
  Then I should see "#image" contents match "^http://placehold.it/20x20"
18
17
  Then I should see "#resource_name" contents match "kazehakase"
19
-
@@ -1,21 +1,15 @@
1
1
  Feature: Lorem generating helper
2
-
3
2
  Scenario: Lorem Helper
4
3
  Given the Server is running at "chuumon_no_ooi_ryouriten"
5
4
  Then going to "/word.html" should not raise an exception
6
5
  Then I should see "#word" contents have over "2" chars
7
6
  Then I should see "#words5" contents have over "10" chars
8
7
  Then I should see "#sentence" contents have over "#{2*6}" chars
9
- Then I should see "#sentence" contents have "1" sentences
8
+ Then I should see "#sentence" contents have "1" sentences
10
9
  Then I should see "#sentences3" contents have over "6" chars
11
10
  Then I should see "#sentences3" contents have "3" sentences
12
11
  Then I should see "#paragraph" contents have "1" paragraphs
13
12
  Then I should see "#paragraphs3" contents have "3" paragraphs
14
- Then I should see "#date" contents match "\d{4}年\d{2}月\d{2}日"
13
+ Then I should see "#date" contents match "\d{4}年\d{2}月\d{2}日"
15
14
  Then I should see "#image" contents match "^http://placehold.it/20x20"
16
15
  Then I should see "#resource_name" contents match "chuumon_no_ooi_ryouriten"
17
-
18
-
19
-
20
-
21
-
@@ -0,0 +1,27 @@
1
+ Feature: Lorem generating helper
2
+ Scenario: Lorem Helper
3
+ Given the Server is running at "reload_resource"
4
+ Then going to "/word.html" should not raise an exception
5
+ Then I should see "#word" contents have over "2" chars
6
+ Then I should see "#words5" contents have over "10" chars
7
+ Then I should see "#sentence" contents have over "#{2*6}" chars
8
+ Then I should see "#sentence" contents have "1" sentences
9
+ Then I should see "#sentences3" contents have over "6" chars
10
+ Then I should see "#sentences3" contents have "3" sentences
11
+ Then I should see "#paragraph" contents have "1" paragraphs
12
+ Then I should see "#paragraphs3" contents have "3" paragraphs
13
+ Then I should see "#date" contents match "\d{4}年\d{2}月\d{2}日"
14
+ Then I should see "#image" contents match "^http://placehold.it/20x20"
15
+ Then I should see "#resource_name" contents match "chuumon_no_ooi_ryouriten"
16
+
17
+ Then I should see "#k-resource_name" contents match "kazehakase"
18
+ Then I should see "#k-word" contents have over "2" chars
19
+ Then I should see "#k-words5" contents have over "10" chars
20
+ Then I should see "#k-sentence" contents have over "#{2*6}" chars
21
+ Then I should see "#k-sentence" contents have "1" sentences
22
+ Then I should see "#k-sentences3" contents have over "6" chars
23
+ Then I should see "#k-sentences3" contents have "3" sentences
24
+ Then I should see "#k-paragraph" contents have "1" paragraphs
25
+ Then I should see "#k-paragraphs3" contents have "3" paragraphs
26
+ Then I should see "#k-date" contents match "\d{4}年\d{2}月\d{2}日"
27
+ Then I should see "#k-image" contents match "^http://placehold.it/20x20"
@@ -0,0 +1 @@
1
+ activate :ya_lorem_ja, :resource_name => :chuumon_no_ooi_ryouriten
@@ -0,0 +1,20 @@
1
+ <div id="#resource_name"><%= lorem_ja.resource_name %></div>
2
+ <div id="#word"><%= lorem_ja.word %></div>
3
+ <div id="#words5"><%= lorem_ja.words(5) %></div>
4
+ <div id="#sentence"><%= lorem_ja.sentence %></div>
5
+ <div id="#sentences3"><%= lorem_ja.sentences(3) %></div>
6
+ <div id="#paragraph"><%= lorem_ja.paragraph %></div>
7
+ <div id="#paragraphs3"><%= lorem_ja.paragraphs(3) %></div>
8
+ <div id="#date"><%= lorem_ja.date %></div>
9
+ <div id="#image"><%= lorem_ja.image("20x20") %></div>
10
+
11
+ <% lorem_ja.reload_resource(:kazehakase) %>
12
+ <div id="#k-resource_name"><%= lorem_ja.resource_name %></div>
13
+ <div id="#k-word"><%= lorem_ja.word %></div>
14
+ <div id="#k-words5"><%= lorem_ja.words(5) %></div>
15
+ <div id="#k-sentence"><%= lorem_ja.sentence %></div>
16
+ <div id="#k-sentences3"><%= lorem_ja.sentences(3) %></div>
17
+ <div id="#k-paragraph"><%= lorem_ja.paragraph %></div>
18
+ <div id="#k-paragraphs3"><%= lorem_ja.paragraphs(3) %></div>
19
+ <div id="#k-date"><%= lorem_ja.date %></div>
20
+ <div id="#k-image"><%= lorem_ja.image("20x20") %></div>
@@ -46,15 +46,25 @@ module Middleman
46
46
  def self.instance(resource_name=DEFAULT_RESOURCE_NAME, char_count_range=DEFAULT_CHAR_COUNT_RANGE_IN_WORD, word_count_range=DEFAULT_WORD_COUNT_RANGE_IN_SENTENCE, sentence_count_range=DEFAULT_SENTENCE_COUNT_RANGE_IN_PARAGRAPH)
47
47
  return @@singleton__instance__ if @@singleton__instance__
48
48
  @@singleton__mutex__.synchronize {
49
- return @@singleton__instance__ if @@singleton__instance__
49
+ return @@singleton__instance__ if @@singleton__instance__
50
50
  @@singleton__instance__ = new(resource_name, char_count_range, word_count_range, sentence_count_range)
51
51
  }
52
52
  @@singleton__instance__
53
53
  end
54
54
 
55
+ def self.reload_resource(resource_name=DEFAULT_RESOURCE_NAME, char_count_range=DEFAULT_CHAR_COUNT_RANGE_IN_WORD, word_count_range=DEFAULT_WORD_COUNT_RANGE_IN_SENTENCE, sentence_count_range=DEFAULT_SENTENCE_COUNT_RANGE_IN_PARAGRAPH)
56
+ @@singleton__mutex__.synchronize {
57
+ if @@singleton__instance__ == nil
58
+ @@singleton__instance__ = new(resource_name, char_count_range, word_count_range, sentence_count_range)
59
+ else
60
+ @@singleton__instance__.reload_resource(resource_name, char_count_range, word_count_range, sentence_count_range)
61
+ end
62
+ }
63
+ end
64
+
55
65
  def self.reset_instance
56
66
  @@singleton__mutex__.synchronize {
57
- @@singleton__instance__ = nil if @@singleton__instance__
67
+ @@singleton__instance__ = nil if @@singleton__instance__
58
68
  }
59
69
  end
60
70
 
@@ -67,7 +77,7 @@ module Middleman
67
77
  merged_opts = default_options.merge(opts)
68
78
  super(total, merged_opts)
69
79
  end
70
-
80
+
71
81
  private
72
82
  def initialize(resource_name, char_count_range, word_count_range, sentence_count_range)
73
83
  super(resource_name, char_count_range, word_count_range, sentence_count_range)
@@ -93,4 +103,4 @@ end
93
103
  # version of class name
94
104
 
95
105
  # MyExtension.register(:my_extension)
96
- ::Middleman::YaLoremJa::Extension.register(::Middleman::YaLoremJa::Extension::EXTENSION_NAME)
106
+ ::Middleman::YaLoremJa::Extension.register(::Middleman::YaLoremJa::Extension::EXTENSION_NAME)
@@ -33,7 +33,6 @@ end
33
33
  Given /^the Server is running$/ do
34
34
  root_dir = File.expand_path(current_dir)
35
35
 
36
-
37
36
  if File.exists?(File.join(root_dir, 'source'))
38
37
  ENV['MM_SOURCE'] = 'source'
39
38
  else
@@ -76,7 +75,7 @@ end
76
75
 
77
76
  Then /^going to "([^\"]*)" should not raise an exception$/ do |url|
78
77
  cd('.') do
79
-
78
+
80
79
  expect{ visit(URI.encode(url).to_s) }.to_not raise_exception
81
80
  end
82
81
  end
@@ -171,4 +170,3 @@ Then /^I should see "([^\"]*)" contents match "(.*)"$/ do |id, regex|
171
170
  expect(content).to match(/#{ regex }/m)
172
171
  end
173
172
  end
174
-
@@ -1,6 +1,6 @@
1
1
  module Middleman
2
2
  # GeoPattern
3
3
  module YaLoremJa
4
- VERSION = '0.0.4'
4
+ VERSION = '0.0.5'
5
5
  end
6
6
  end
@@ -15,10 +15,10 @@ Gem::Specification.new do |s|
15
15
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
16
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
17
  s.require_paths = ["lib"]
18
-
18
+
19
19
  # The version of middleman-core your extension depends on
20
20
  s.add_runtime_dependency("middleman-core", [">= 3.3.12"])
21
-
21
+
22
22
  # Additional dependencies
23
- s.add_runtime_dependency("ya_lorem_ja", ">= 0.0.4")
23
+ s.add_runtime_dependency("ya_lorem_ja", ">= 0.0.5")
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-ya_lorem_ja
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - kenji tanaka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-11 00:00:00.000000000 Z
11
+ date: 2015-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman-core
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '>='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.4
33
+ version: 0.0.5
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.4
40
+ version: 0.0.5
41
41
  description: Yet Another Japanese Lorem Ipsum generator For Middleman
42
42
  email:
43
43
  executables: []
@@ -50,10 +50,13 @@ files:
50
50
  - Rakefile
51
51
  - features/helpers_ya_lorem_ja.feature
52
52
  - features/helpers_ya_lorem_ja_change_resource.feature
53
+ - features/helpers_ya_lorem_ja_reload_resource.feature
53
54
  - features/support/env.rb
54
55
  - features/support/hook.rb
55
56
  - fixtures/chuumon_no_ooi_ryouriten/config.rb
56
57
  - fixtures/chuumon_no_ooi_ryouriten/source/word.html.erb
58
+ - fixtures/reload_resource/config.rb
59
+ - fixtures/reload_resource/source/word.html.erb
57
60
  - fixtures/test-app/config.rb
58
61
  - fixtures/test-app/source/word.html.erb
59
62
  - lib/middleman-ya_lorem_ja.rb
@@ -90,6 +93,7 @@ summary: Yet Another Japanese Lorem Ipsum generator For Middleman
90
93
  test_files:
91
94
  - features/helpers_ya_lorem_ja.feature
92
95
  - features/helpers_ya_lorem_ja_change_resource.feature
96
+ - features/helpers_ya_lorem_ja_reload_resource.feature
93
97
  - features/support/env.rb
94
98
  - features/support/hook.rb
95
99
  has_rdoc: