architecture 6.0.5 → 6.0.6
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 +4 -4
- data/lib/architecture/dsl.rb +13 -10
- data/lib/architecture/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dec6cc51d2bc3e079342150aedebed5785025e07
|
4
|
+
data.tar.gz: b879fd96d46c8ff893ec67967e9d5523efbeecae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd20a9b6e42bb1090d139d345e0f3900ea43b0abe15097dd4c1de164d4fc5ed1ec20294455ef010d3f575d13a03b6d63721108467df84c0b0b20233014bc42a0
|
7
|
+
data.tar.gz: 6557d0d9b8eee146fa346ccaa9001d5fb56908cc4424ae6bc23fe90aaa51af9ae65642869a599f67062c9931403cefc5a5945d3196ea4757f8afd0d95b8afcb0
|
data/lib/architecture/dsl.rb
CHANGED
@@ -15,7 +15,7 @@ module Architecture
|
|
15
15
|
a = Entity.new(id: directory || file, prefix: @source)
|
16
16
|
b = Entity.new(id: as || directory || file, prefix: @destination)
|
17
17
|
|
18
|
-
@output.print("#{indentention}Copying #{a} to #{b}")
|
18
|
+
@output.print("#{indentention}Copying #{truncate(a.to_s)} to #{truncate(b.to_s)}")
|
19
19
|
|
20
20
|
Copy.new(source: a, destination: b, context: context).call
|
21
21
|
|
@@ -30,7 +30,7 @@ module Architecture
|
|
30
30
|
a = Entity.new(id: directory || file, prefix: @source)
|
31
31
|
b = Entity.new(id: as, prefix: @destination)
|
32
32
|
|
33
|
-
@output.print("#{indentention}Moving #{a} to #{b}")
|
33
|
+
@output.print("#{indentention}Moving #{truncate(a.to_s)} to #{truncate(b.to_s)}")
|
34
34
|
|
35
35
|
Move.new(source: a, destination: b).call
|
36
36
|
|
@@ -44,7 +44,7 @@ module Architecture
|
|
44
44
|
def create(file: nil, directory: nil, content: nil, context: EMPTY_CONTEXT, location: nil, &block)
|
45
45
|
a = Entity.new(id: directory || file, prefix: location || @destination)
|
46
46
|
|
47
|
-
@output.print("#{indentention}Creating #{a}")
|
47
|
+
@output.print("#{indentention}Creating #{truncate(a.to_s)}")
|
48
48
|
|
49
49
|
Create.new(source: a, content: content, context: context).call
|
50
50
|
|
@@ -58,7 +58,7 @@ module Architecture
|
|
58
58
|
def delete(directory: nil, file: nil, location: nil)
|
59
59
|
a = Entity.new(id: directory || file, prefix: location || @destination)
|
60
60
|
|
61
|
-
@output.print("#{indentention}Deleting #{a}")
|
61
|
+
@output.print("#{indentention}Deleting #{truncate(a.to_s)}")
|
62
62
|
|
63
63
|
Delete.new(source: a).call
|
64
64
|
|
@@ -68,7 +68,7 @@ module Architecture
|
|
68
68
|
def replace(file:, search:, content:, location: nil)
|
69
69
|
a = Entity.new(id: file, prefix: location || @destination)
|
70
70
|
|
71
|
-
@output.print("#{indentention}Replacing content in #{a}")
|
71
|
+
@output.print("#{indentention}Replacing content in #{truncate(a.to_s)}")
|
72
72
|
|
73
73
|
Replace.new(source: a, search: search, content: content).call
|
74
74
|
|
@@ -78,8 +78,7 @@ module Architecture
|
|
78
78
|
def prepend(file:, content:, context: Architecture::EMPTY_CONTEXT, location: nil)
|
79
79
|
a = Entity.new(id: file, prefix: location || @destination)
|
80
80
|
|
81
|
-
@output.print("#{indentention}Prepending #{a} with content")
|
82
|
-
|
81
|
+
@output.print("#{indentention}Prepending #{truncate(a.to_s)} with content")
|
83
82
|
|
84
83
|
Prepend.new(source: a, content: content, context: context).call
|
85
84
|
|
@@ -89,7 +88,7 @@ module Architecture
|
|
89
88
|
def append(file:, content:, context: Architecture::EMPTY_CONTEXT, location: nil)
|
90
89
|
a = Entity.new(id: directory || file, prefix: location || @destination)
|
91
90
|
|
92
|
-
@output.print("#{indentention}Appending #{a}")
|
91
|
+
@output.print("#{indentention}Appending #{a} with content")
|
93
92
|
|
94
93
|
Append.new(source: a, content: content, context: context).call
|
95
94
|
|
@@ -99,7 +98,7 @@ module Architecture
|
|
99
98
|
def overwrite(file:, content:, context: Architecture::EMPTY_CONTEXT, location: nil)
|
100
99
|
a = Entity.new(id: directory || file, prefix: location || @destination)
|
101
100
|
|
102
|
-
@output.print("#{indentention}
|
101
|
+
@output.print("#{indentention}Overwriting #{truncate(a.to_s)} with content")
|
103
102
|
|
104
103
|
Overwrite.new(source: a, content: content, context: context).call
|
105
104
|
|
@@ -107,7 +106,7 @@ module Architecture
|
|
107
106
|
end
|
108
107
|
|
109
108
|
def within(directory: nil, source: @source, destination: @destination, &block)
|
110
|
-
@output.puts "#{indentention}Within #{
|
109
|
+
@output.puts "#{indentention}Within #{directory || truncate(destination)}"
|
111
110
|
|
112
111
|
self.class.new(source: join(@source, directory || source), destination: join(@destination, directory || destination), output: @output, level: @level + 1, &block)
|
113
112
|
end
|
@@ -119,5 +118,9 @@ module Architecture
|
|
119
118
|
private def indentention
|
120
119
|
"\t" * @level
|
121
120
|
end
|
121
|
+
|
122
|
+
private def truncate(path)
|
123
|
+
path.split("/").last(@level).join("/")
|
124
|
+
end
|
122
125
|
end
|
123
126
|
end
|
data/lib/architecture/version.rb
CHANGED