goku 1.1 → 1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77d5962fbe6081b404f534e273ba071e8c85ca1c
4
- data.tar.gz: b32520bd492838fc6c10b52134e279908f1722cf
3
+ metadata.gz: e6b27050ac4a74db4982c7bebe914e61dac5af44
4
+ data.tar.gz: 418fe95d2a3439dea5102a78be7c6c25f55fdf53
5
5
  SHA512:
6
- metadata.gz: b278ee3e85a499173cc34f52df2f1628f4a5c5c1f6c666ae2dcd33c7a817db7cfc827c96cfce162aa0c7aa67b725ded230ffc6cc531fd4dfb3312eb9e3fa4182
7
- data.tar.gz: 1aa5c15545e08971797e049861f39e933912e9394b0ce8b49db86d24b8d40050b538d7c3c96267952874f7da08731bbcb0a182abf5c84dfbe1037fa025e2810d
6
+ metadata.gz: 6a93a4c448769763f7873fa739e3e37eea8c1f35ecf0a1bc95bb6150b9faaa7401e9f0d2b22f789ae06462d5ad999df6122f101cb80ccccc9a776f357f617efa
7
+ data.tar.gz: 64fb97ddd37537ee98d5a5cbce8642343d5011364295d3020d04a9d4c64a3a4660ef8cc4c611905e2f5a11f418e41851fe463cb74e2d351c6322b64a9aa31398
@@ -33,12 +33,10 @@ module Goku
33
33
  failure("Spec #{path.to_spec.full.colorize(:red)} already exists") if path.to_spec.exists?
34
34
 
35
35
  puts "Creating #{path.full.colorize(:green)}"
36
- FileUtils.mkdir_p(File.dirname(path.full))
37
- File.write(path.full, implementation)
36
+ path.write(implementation)
38
37
 
39
38
  puts "Creating #{path.to_spec.full.colorize(:green)}"
40
- FileUtils.mkdir_p(File.dirname(path.to_spec.full))
41
- File.write(path.to_spec.full, spec)
39
+ path.to_spec.write(spec)
42
40
  end
43
41
 
44
42
  def failure(message)
@@ -28,11 +28,11 @@ module Goku
28
28
  end
29
29
 
30
30
  def nested(element)
31
- ancestors.each_cons(2) { |parent, sub| parent.add(sub) }
31
+ elements = ancestors << element
32
32
 
33
- ancestors.last.add(element)
33
+ elements.each_cons(2) { |parent, sub| parent.add(sub) }
34
34
 
35
- ancestors.first
35
+ elements.first
36
36
  end
37
37
 
38
38
  end
@@ -8,6 +8,12 @@ module Goku
8
8
  @full= raw_path
9
9
  end
10
10
 
11
+ def write(content)
12
+ FileUtils.mkdir_p(File.dirname(full))
13
+
14
+ File.write(full, "#{content}\n")
15
+ end
16
+
11
17
  def exists?
12
18
  File.exists?(full)
13
19
  end
@@ -1,3 +1,3 @@
1
1
  module Goku
2
- VERSION = "1.1"
2
+ VERSION = "1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: goku
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.1'
4
+ version: '1.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Šarčević
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-06 00:00:00.000000000 Z
11
+ date: 2016-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor