charmkit 0.4.8 → 0.4.9

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: 4487ffdd9f42177d0b98dbe8ade34b2fd7feb3e2
4
- data.tar.gz: 682d10d0feef7c241d4f8cb94a3e7aceaed8d121
3
+ metadata.gz: d1ed1d1b33b056348463ac9f861a8d64d0f58a9c
4
+ data.tar.gz: 0afb41943b5aec098e1b0798b01d9f5d37f7296d
5
5
  SHA512:
6
- metadata.gz: 87a387953fc9b7e44802e801a445eb9675cdbe20facb81343c5bc3fd929834603158153a8fb123f92b7943ab06c4a1b67b6cd515d4ad4011db84de8c85da7201
7
- data.tar.gz: feed85b1ece91c509177b6802e5fd3d94ba2eeae099e5ba0fe85ca651b6208805b5498b59b2efc0d178aa2df726666b3c5e612903bfb0c08c82a961836224671
6
+ metadata.gz: d0fa005597463a6d1cca7bfea6b91d6ef35372dfbcc1d7ec9dbae66ea52a3e4fe20438973e34d538c75c1427d8baab97f16bb9c81e116665dad44bb9670fe6c0
7
+ data.tar.gz: 072010d8fc17dd186b62b42c4a90db4422ea61b96939782db674af0226bcd80d83bebb04e5730c6103efe96b0cd49a5b1ee0264475d541b73551cdb354e488fc
data/charmkit.gemspec CHANGED
@@ -22,6 +22,8 @@ Gem::Specification.new do |spec|
22
22
  spec.require_paths = ["lib"]
23
23
 
24
24
  spec.add_dependency "tty-command"
25
+ spec.add_dependency "activesupport"
26
+ spec.add_dependency "thor"
25
27
 
26
28
  spec.add_development_dependency "bundler", "~> 1.13"
27
29
  spec.add_development_dependency "rake", "~> 10.0"
@@ -7,32 +7,33 @@ require 'charmkit/plugins/php'
7
7
  # The below require_relative will load a local task from tasks/vim.rb
8
8
  require_relative "tasks/vim.rb"
9
9
 
10
+
11
+
12
+ app_path = path(config('app_path'))
13
+
10
14
  namespace :dokuwiki do
11
15
 
12
16
  desc "Install Dokuwiki"
13
17
  # Notice that I set task dependencies on nginx, php, AND vim
14
18
  # so that they get installed prior to installing dokuwiki
15
19
  task :install => ["nginx:install", "php:install", "vim:install"] do
16
- app_path = `config-get app_path`.chomp
17
20
  resource_path = `resource-get stable-release`.chomp
18
- hook_path = ENV['JUJU_CHARM_DIR']
19
21
 
20
- mkdir_p app_path unless Dir.exists? app_path
22
+ mkdir_p app_path unless app_path.directory?
23
+
24
+ run "tar", "xf", resource_path, "-C", app_path, "--strip-components=1"
21
25
 
22
- `tar xf #{resource_path} -C #{app_path} --strip-components=1`
23
26
  cp "#{hook_path}/templates/acl.auth.php", "#{app_path}/conf/acl.auth.php"
24
27
  cp "#{hook_path}/templates/local.php", "#{app_path}/conf/local.php"
25
28
  cp "#{hook_path}/templates/plugins.local.php", "#{app_path}/conf/plugin.local.php"
26
29
 
27
30
  version = File.read "#{app_path}/VERSION"
28
- `application-version-set '#{version}'`
29
- `status-set active "Dokuwiki Install finished."`
31
+ run "application-version-set", version.chomp
32
+ run "status-set", "active", "Dokuwiki Install finished."
30
33
  end
31
34
 
32
35
  desc "Configure Dokuwiki"
33
36
  task :config_changed do
34
- app_path = `config-get app_path`.chomp
35
- hook_path = ENV['JUJU_CHARM_DIR']
36
37
 
37
38
  admin_user = `config-get admin_user`.chomp
38
39
  admin_password = `config-get admin_password`.chomp
@@ -1,5 +1,12 @@
1
+ require 'pathname'
2
+
1
3
  module Charmkit
2
4
  module Helpers
5
+ # sugar over pathname
6
+ def path(pn)
7
+ Pathname.new(pn)
8
+ end
9
+
3
10
  # Create a file with data
4
11
  #
5
12
  # @param dst String
@@ -1,5 +1,12 @@
1
1
  module Charmkit
2
2
  module Helpers
3
+ # Hook path within a charm execution
4
+ #
5
+ # @return [String]
6
+ def hook_path
7
+ ENV['JUJU_CHARM_DIR']
8
+ end
9
+
3
10
  def status(level=:maintenance, msg="")
4
11
  levels = [:maintenance, :active, :blocked, :waiting]
5
12
  raise unless levels.include?(level)
@@ -2,8 +2,15 @@ require 'tty-command'
2
2
 
3
3
  module Charmkit
4
4
  module Helpers
5
+ extend Forwardable
6
+ def_delegators :cmd, :run, :run!, :test
7
+
5
8
  def cmd
6
- return TTY::Command.new
9
+ if ENV['DRYRUN']
10
+ TTY::Command.new(dryrun: true)
11
+ else
12
+ TTY::Command.new
13
+ end
7
14
  end
8
15
  end
9
16
  end
@@ -6,7 +6,7 @@ module Charmkit
6
6
  module VERSION
7
7
  MAJOR = 0
8
8
  MINOR = 4
9
- PATCH = 8
9
+ PATCH = 9
10
10
  PRE = nil
11
11
 
12
12
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: charmkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.8
4
+ version: 0.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Stokes
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-12 00:00:00.000000000 Z
11
+ date: 2016-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-command
@@ -24,6 +24,34 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activesupport
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: thor
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: bundler
29
57
  requirement: !ruby/object:Gem::Requirement