rigit 0.1.9 → 0.2.0

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
  SHA256:
3
- metadata.gz: 0d4376ecf78831ccb63f15b993a69b585ea34dacd9de6f0340f3094f3a09aefc
4
- data.tar.gz: ed06a35410a3b6045ad336f0e0ec80470bec5e735c4aa8f0d6d39bdb47f6d905
3
+ metadata.gz: 191f04f34e7debb617f20816fa03f4f02beac4e3ab582542d56fba351d1132af
4
+ data.tar.gz: ffc4b29dfef9aa611e79af752f55bdc528d3714541bfc37104ecdaf30058a7f2
5
5
  SHA512:
6
- metadata.gz: 70b34461b1528b28e3051c820562ec5ca25ee928b5d2d9ece8c285965a93a37567072fb3f724c53f93001143e10bfb059db86c9acaaa9bf5c8b45a4a30f8fd03
7
- data.tar.gz: 9bc8dbb1bb780f7cffc40509c23de8bbec5030bbb4c7fdeda1437ea010f0248261e185ccdc5aec92980ccf3ec283feaa24bcfbc6a4e20ed5a57a2f5d51f3a24f
6
+ metadata.gz: c815d832ef57a36aefdd7be9a0eed9393e3e7aba681d187fcef3988cb4df4b6d6e1df6d7eba0d2c36dbeeb20a95b449dd982983b6252e9a77a0f25d5564fcce4
7
+ data.tar.gz: 96762113e02254019bf149af50aff41afc0e45972a39b640de360f216a93dd6c21f4b1df7f9f18d0f218d96b77bb11274a41c0476e42089190455ef04a7f44f3
data/README.md CHANGED
@@ -227,6 +227,13 @@ after:
227
227
  "Install Dependencies": "bundle install"
228
228
  "Initialize git repo": "git init"
229
229
 
230
+ # Specify file patterns that should be copoied as is (without variable
231
+ # replacements).
232
+ binaries:
233
+ - "*.png"
234
+ - "*.pdf"
235
+ - "some-binary-file"
236
+
230
237
  # Parameters to collect on scaffolding
231
238
  params:
232
239
  name:
data/lib/rigit/rig.rb CHANGED
@@ -99,9 +99,25 @@ module Rigit
99
99
  end
100
100
 
101
101
  def get_file_content(file, arguments)
102
+ if binary? file
103
+ File.read file
104
+ else
105
+ eval_file_content file, arguments
106
+ end
107
+ end
108
+
109
+ def eval_file_content(file, arguments)
102
110
  File.read(file) % arguments
103
111
  rescue ArgumentError, KeyError => e
104
112
  raise TemplateError.new file, e.message
105
113
  end
114
+
115
+ def binary?(file)
116
+ return false unless config.binaries
117
+ config.binaries.each do |pattern|
118
+ return true if File.fnmatch pattern, file
119
+ end
120
+ false
121
+ end
106
122
  end
107
123
  end
data/lib/rigit/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rigit
2
- VERSION = "0.1.9"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rigit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-10 00:00:00.000000000 Z
11
+ date: 2019-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: super_docopt