hq-dev 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad42d04f4d6edcdca3ebfc869a8e505ab0a4167c
4
- data.tar.gz: b5b17bdb9cc271d1972e7aed0c3d69c38b694a6c
3
+ metadata.gz: f6a564c6509f17e61b34ec035e526a4ee5b98141
4
+ data.tar.gz: 0571f085434341f02b52dd773fe0774416c46f26
5
5
  SHA512:
6
- metadata.gz: a9261497526accacc67bba022039f2417950477f2c0670c7b6fbb2bdab331c0d8ad14c7cba6b198cebccdca8f76fa4615f22fe92ada7990d86fe2a3c723db1b2
7
- data.tar.gz: abb29a0030b6ad549b44a13b6c797c370bf8b5882020ed04dcdbf2c11fea1719ea40d2ecee01e3feb3a2c912302a67150144fbf63133dff1d5cf26ef9cbaa064
6
+ metadata.gz: 54861def6e4636a4451f9cf67a6976c2428bcc101d35354ef8202cd2b837af164286efabf7021a2aa24ce782781faf1e6fbd4cf07720fdaee93aac387445a6e8
7
+ data.tar.gz: 4f2e317ba323a41ab5a9d9f38c22fcc558f781074b80ec299bc2ebeb9fce65786226c5bd9c00cbdbec8a968dbb921191c491787135213c0695827462258f4210
data/data/gem-versions CHANGED
@@ -1,7 +1,7 @@
1
1
  bson_ext 1.8.5
2
2
  capybara 2.0.2
3
3
  cucumber 1.3.1
4
- hq-dev 0.0.10
4
+ hq-dev 0.0.11
5
5
  hq-engine 0.0.3
6
6
  hq-tools 0.8.0
7
7
  hq-web 0.0.2
@@ -11,6 +11,9 @@ Feature: Temporary directory and files
11
11
 
12
12
  Given a file "features/support/steps.rb":
13
13
  """
14
+ Before do
15
+ $placeholders["${name}"] = "world"
16
+ end
14
17
  Then /^the file is created correctly$/ do
15
18
  File.read("abc.def").should == "Hello world"
16
19
  end
@@ -19,12 +22,18 @@ Feature: Temporary directory and files
19
22
  And a file "features/test.feature":
20
23
  """
21
24
  Feature:
22
- Scenario:
25
+ Scenario: Simple file
23
26
  Given a file "abc.def":
24
27
  \"\"\"
25
28
  Hello world
26
29
  \"\"\"
27
30
  Then the file is created correctly
31
+ Scenario: Placeholders
32
+ Given a file "abc.def":
33
+ \"\"\"
34
+ Hello ${name}
35
+ \"\"\"
36
+ Then the file is created correctly
28
37
  """
29
38
 
30
39
  When I run "cucumber"
@@ -32,8 +41,8 @@ Feature: Temporary directory and files
32
41
  Then the exit status should be 0
33
42
  And the output should contain:
34
43
  """
35
- 1 scenario (1 passed)
36
- 2 steps (2 passed)
44
+ 2 scenarios (2 passed)
45
+ 4 steps (4 passed)
37
46
  """
38
47
 
39
48
  Scenario: Create a directory
@@ -8,6 +8,8 @@ Before do
8
8
 
9
9
  Dir.chdir @temp_dir
10
10
 
11
+ $placeholders = {}
12
+
11
13
  end
12
14
 
13
15
  After do
@@ -25,6 +27,20 @@ Given /^a file "(.+)":$/ do
25
27
 
26
28
  FileUtils.mkdir_p dir_name
27
29
 
30
+ regex_str =
31
+ $placeholders.keys.map {
32
+ |key|
33
+ Regexp.quote key
34
+ }.join("|")
35
+
36
+ regex =
37
+ Regexp.new regex_str
38
+
39
+ file_contents =
40
+ file_contents.gsub(regex) {
41
+ |key| $placeholders[key]
42
+ }
43
+
28
44
  File.open file_name, "w" do
29
45
  |file_io|
30
46
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hq-dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Pharaoh