dicker 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/dicker +23 -13
- data/lib/dicker/build.rb +24 -9
- data/lib/dicker/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ae0c2ceea1a3527f3dd4d726e2cb3648cf7a0f9
|
4
|
+
data.tar.gz: 34ac43c4ff25e01bd381447dd71fd84d6ba8be24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ada3fe525be6cccfeb751548d69dc7892b2b461dd5a58247665a4904708d7f443bac99f35c928a6df7795c89d78d9a5b899f0e55652f2e99beaefd488e726ede
|
7
|
+
data.tar.gz: b9e32c3d4b9241475031bc8a966f2ffdbe000b44ea43ec3beb8ca65f8b3a79101137ec32dc19c7cd827727e6e6ef7a05050b1be849ecf295332578dda9cf632f
|
data/bin/dicker
CHANGED
@@ -5,21 +5,31 @@ require 'dicker'
|
|
5
5
|
argument = ARGV[0]
|
6
6
|
project = ARGV[1]
|
7
7
|
|
8
|
+
source = 'pegisis'
|
9
|
+
|
10
|
+
if !ARGV[2].nil?
|
11
|
+
source = ARGV[2]
|
12
|
+
end
|
13
|
+
|
14
|
+
build = false
|
15
|
+
|
8
16
|
if !argument.nil?
|
9
17
|
case argument
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
when 'dynamic'
|
19
|
+
Dicker.build(project, source)
|
20
|
+
when 'static'
|
21
|
+
Dicker.build(project, 'curtiss')
|
22
|
+
else
|
23
|
+
puts "--> Avaliable tasks:"
|
24
|
+
puts "\n"
|
25
|
+
puts " - static - will generate curtiss"
|
26
|
+
puts " - dynamic"
|
27
|
+
puts "\n"
|
28
|
+
puts "Ensure you provide a name for the project after a command call"
|
29
|
+
end
|
30
|
+
|
31
|
+
if build
|
32
|
+
|
23
33
|
end
|
24
34
|
else
|
25
35
|
puts "--> Please ensure you type a method!"
|
data/lib/dicker/build.rb
CHANGED
@@ -1,15 +1,30 @@
|
|
1
1
|
class Dicker::Build
|
2
|
-
def initialize(
|
3
|
-
@project =
|
2
|
+
def initialize(project, source_dir)
|
3
|
+
@project = project
|
4
|
+
@source_dir = source_dir
|
4
5
|
end
|
5
6
|
|
6
|
-
def
|
7
|
-
|
8
|
-
|
7
|
+
def build
|
8
|
+
self.copy_files
|
9
|
+
self.init_git
|
9
10
|
end
|
10
11
|
|
11
|
-
def
|
12
|
-
|
13
|
-
|
12
|
+
def init_git
|
13
|
+
Dir.chdir @project
|
14
|
+
system('git init')
|
14
15
|
end
|
15
|
-
|
16
|
+
|
17
|
+
def copy_files
|
18
|
+
Find.find("#{@source_dir}") do |source|
|
19
|
+
target = source.sub(/^#{@source_dir}/, @project)
|
20
|
+
if File.directory? source
|
21
|
+
Find.prune if File.basename(source) == '.git'
|
22
|
+
FileUtils.mkdir target unless File.exists? target
|
23
|
+
else
|
24
|
+
FileUtils.copy source, target
|
25
|
+
puts "Copying #{source}"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
data/lib/dicker/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dicker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ashley Banks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|