pave 0.0.1 → 0.0.2

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
  SHA1:
3
- metadata.gz: f1ea13cec4d8a25ed90deb776147cef004f70104
4
- data.tar.gz: 83bfe7e1a1329cb4f0f76dd4dce0f9e52264c6c8
3
+ metadata.gz: 8a15b53e4bc720ef0a81cf2a48ad9657479cfacb
4
+ data.tar.gz: 0cb172b83a7175c8a70406a590df6002bf37d8ee
5
5
  SHA512:
6
- metadata.gz: 365ad10ee002041c4911b8f1dc1e8ee6f82aaf88abe89a88eac644f8a75ec18b6994bb6de999918dfa76e1abc114247b404563f76d9b951e33b202f09193e2ae
7
- data.tar.gz: 4640feff6d8ae1c9e3652a630f4c2043b05f27b5b8211b8ec2467eac544131ce683faaeaf9883239dff221aefd7e17f0fe991c476863ba5a994e040deddb0f62
6
+ metadata.gz: c7708d3c6197c05e6c7a7430be43ae3c3446a9b997eae09d47b3adc9285d3ec99b673992b0763ee23c5bd582566d99b87ba8e266cc7ce6d4f6b2bd94f5f6f48a
7
+ data.tar.gz: ada7a38d664d9b5815bce09cad4820d88d670ab764a0e4a2da54eec0022ada16d6ea722ccd5ea8f0c35a9b574e005bb63d6e4fbfec0636d9fdc0d43a9f3ea3e9
data/.gitignore CHANGED
@@ -2,3 +2,4 @@
2
2
  results.html
3
3
  pkg
4
4
  html
5
+ .gem
data/Gemfile.lock CHANGED
@@ -1,45 +1,23 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pave (0.0.1)
4
+ pave (0.0.2)
5
5
  methadone (~> 1.3.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- aruba (0.5.3)
11
- childprocess (>= 0.3.6)
12
- cucumber (>= 1.1.1)
13
- rspec-expectations (>= 2.7.0)
14
- builder (3.2.2)
15
- childprocess (0.3.9)
16
- ffi (~> 1.0, >= 1.0.11)
17
- cucumber (1.3.8)
18
- builder (>= 2.1.2)
19
- diff-lcs (>= 1.1.3)
20
- gherkin (~> 2.12.1)
21
- multi_json (>= 1.7.5, < 2.0)
22
- multi_test (>= 0.0.2)
23
- diff-lcs (1.2.4)
24
- ffi (1.9.0)
25
- gherkin (2.12.1)
26
- multi_json (~> 1.3)
27
10
  json (1.8.0)
28
11
  methadone (1.3.0)
29
12
  bundler
30
- multi_json (1.8.1)
31
- multi_test (0.0.2)
32
13
  rake (0.9.6)
33
14
  rdoc (4.0.1)
34
15
  json (~> 1.4)
35
- rspec-expectations (2.14.3)
36
- diff-lcs (>= 1.1.3, < 2.0)
37
16
 
38
17
  PLATFORMS
39
18
  ruby
40
19
 
41
20
  DEPENDENCIES
42
- aruba
43
21
  bundler (~> 1.3)
44
22
  pave!
45
23
  rake (~> 0.9.2)
data/bin/pave CHANGED
@@ -8,19 +8,36 @@ class App
8
8
  include Methadone::Main
9
9
  include Methadone::CLILogging
10
10
 
11
- main do |command| # Add args you want: |like,so|
11
+ main do |command, opt| # Add args you want: |like,so|
12
12
  # your program code here
13
13
  # You can access CLI options via
14
14
  # the options Hash
15
- puts "pave - Command line tools for Concrete5."
16
- puts "By Jamon Holmgren"
15
+ info "pave - Command line tools for Concrete5."
16
+ info "By Jamon Holmgren"
17
+
18
+ case command.to_sym
19
+ when :new then Pave::Concrete.create(opt)
20
+ else show_help
21
+ end
22
+
23
+ 0 # Good!
24
+ end
25
+
26
+ def self.show_help
27
+ info "Invalid."
28
+ end
29
+
30
+ def self.create(name)
31
+ info "Creating #{name}..."
32
+ sleep 2
33
+ info "Done."
17
34
  end
18
35
 
19
36
  # supplemental methods here
20
37
 
21
38
  # Declare command-line interface here
22
39
 
23
- # description "Command line for Concrete5 websites."
40
+ description "Command line for Concrete5 websites."
24
41
  #
25
42
  # Accept flags via:
26
43
  # on("--flag VAL","Some flag")
@@ -32,10 +49,10 @@ class App
32
49
  # Or, just call OptionParser methods on opts
33
50
  #
34
51
  # Require an argument
35
- # arg :some_arg
52
+ arg :command
36
53
  #
37
54
  # # Make an argument optional
38
- # arg :optional_arg, :optional
55
+ arg :opt, :optional
39
56
 
40
57
  version Pave::VERSION
41
58
 
data/lib/pave/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pave
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/pave.rb CHANGED
@@ -1,5 +1,81 @@
1
1
  require "pave/version"
2
2
 
3
3
  module Pave
4
- # Your code goes here...
4
+ class Concrete
5
+ include Methadone::CLILogging
6
+ include Methadone::SH
7
+
8
+ attr_accessor :name
9
+
10
+ def self.create(name)
11
+ info ""
12
+ info "Setting up Concrete5 in folder #{name}."
13
+ new(name).setup
14
+ 0
15
+ end
16
+
17
+ def initialize(name)
18
+ @name = name
19
+ end
20
+
21
+ def setup
22
+ clone_concrete5
23
+ set_up_app_folder
24
+ end
25
+
26
+ def clone_concrete5
27
+ info "* Downloading Concrete5 version 5.6.2.1..."
28
+ sh "curl http://www.concrete5.org/download_file/-/view/58379/8497 -o c5.zip"
29
+ info "* Download complete. Unzipping..."
30
+ sh "unzip c5.zip"
31
+ sh "rm c5.zip"
32
+ sh "mv concrete5.6.2.1 #{name}"
33
+ info "* Concrete5 downloaded and unzipped into ./#{name}."
34
+ end
35
+
36
+ def set_up_app_folder
37
+ info "* Setting up folders..."
38
+ sh "mkdir #{name}/app"
39
+
40
+ symlink_folders
41
+ remove_extra_folders
42
+ end
43
+
44
+ def symlink_folders
45
+ symlinked_folders.each do |folder|
46
+ sh "mv #{name}/#{folder} #{name}/app/#{folder}"
47
+ sh "ln -s app/#{folder} #{name}/#{folder}"
48
+ end
49
+ end
50
+
51
+ def symlinked_folders
52
+ [
53
+ :blocks,
54
+ :elements,
55
+ :jobs,
56
+ :libraries,
57
+ :models,
58
+ :packages,
59
+ :page_types,
60
+ :single_pages,
61
+ :themes,
62
+ :tools,
63
+ ]
64
+ end
65
+
66
+ def remove_extra_folders
67
+ sh "rmdir #{name}/" + removed_folders.join(" #{name}/")
68
+ end
69
+
70
+ def removed_folders
71
+ [
72
+ :css,
73
+ :controllers,
74
+ :helpers,
75
+ :js,
76
+ :languages,
77
+ :mail,
78
+ ]
79
+ end
80
+ end
5
81
  end
data/pave.gemspec CHANGED
@@ -21,7 +21,6 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "bundler", "~> 1.3"
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency('rdoc')
24
- spec.add_development_dependency('aruba')
25
24
  spec.add_development_dependency('rake', '~> 0.9.2')
26
25
  spec.add_dependency('methadone', '~> 1.3.0')
27
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pave
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamon Holmgren
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: aruba
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - '>='
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: rake
71
57
  requirement: !ruby/object:Gem::Requirement