dicker 0.0.4 → 0.0.5

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: 46815dac3afcc11f581dd1b818549dca580443ee
4
- data.tar.gz: 49c9447343c8f8081adbd6cb68021604a19753a2
3
+ metadata.gz: 5ae0c2ceea1a3527f3dd4d726e2cb3648cf7a0f9
4
+ data.tar.gz: 34ac43c4ff25e01bd381447dd71fd84d6ba8be24
5
5
  SHA512:
6
- metadata.gz: b239f249744d5a03c2374a26a82008a1c41049b0927953c15a3ddc0c2b560bfe6bfe88643adc7aca97e756cdf553b4e8ead1033520fcb3fb21287c671e20913b
7
- data.tar.gz: 2e71198ecf18b24a9c31d20f93dd89373baf7dad1a3c1f2c381b00e9f313579e458d81eca981485cf12ff8a3483a3eb9b8133166bb9d7c48f18fb09bfe0cad3e
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
- when 'dynamic'
11
- Dicker.static(project, 'dynamic')
12
- when 'static'
13
- Dicker.static(project)
14
- when 'server'
15
- Dicker.server
16
- else
17
- puts "--> Avaliable tasks:"
18
- puts "\n"
19
- puts " - static"
20
- puts " - dynamic"
21
- puts "\n"
22
- puts "Ensure you provide a name for the project after a command call"
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(title)
3
- @project = title
2
+ def initialize(project, source_dir)
3
+ @project = project
4
+ @source_dir = source_dir
4
5
  end
5
6
 
6
- def static
7
- output = system("git clone git@github.com:banksy89/curtiss.git #{@project}")
8
- return output
7
+ def build
8
+ self.copy_files
9
+ self.init_git
9
10
  end
10
11
 
11
- def dynamic
12
- output = system("git clone git@github.com:StormCreative/pegisis.git #{@project}")
13
- return output
12
+ def init_git
13
+ Dir.chdir @project
14
+ system('git init')
14
15
  end
15
- end
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
+
@@ -1,3 +1,3 @@
1
1
  module Dicker
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
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
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-05-29 00:00:00.000000000 Z
11
+ date: 2013-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler