charmkit 0.3.1 → 0.3.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: 80eb981dc102d082b0f5596f4b83101d340faec0
4
- data.tar.gz: 1a581779cc5df31754e6092f8a72bc50e793c3c7
3
+ metadata.gz: 89b4c283b2d6dadc937ccfb891720976b47fe6e4
4
+ data.tar.gz: ff44fd07cf6650aa69428a3688b6420eb3e85d99
5
5
  SHA512:
6
- metadata.gz: 35a5b80cb5a23b2834d6ee127935555b1897cf8b8f5641a22b0f636bcad3d328606ee89ad9ef6eb3d76707c1715abf087eef0ce0684eeafbcfbf83f277c069ea
7
- data.tar.gz: dbfd92058d61b55b0e467c67c348409de3dd5de3446cb546b486c61869f8a5599599aea85b1756b8205ebb90f3b9cd1368885829578a6113e7d12c4644af85f7
6
+ metadata.gz: 120bfb015365589522d5c022f14816df5c751ae9848417936410d9014248fb4465175e58d7d9db8dcf778697aae5066a8f763fe4a955744c3328fb50db76fd57
7
+ data.tar.gz: d059c8cff4a09d9e9555dab319122d5fc2f2971c92afe056a180c8b6c35003e5b0cd55db14b0b40eef2b00b74c3fcc7961ce388986b0f940b8c1b253e99a29d7
data/README.md CHANGED
@@ -1,8 +1,5 @@
1
- # Charmkit
2
-
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/charmkit`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
1
+ # Charmkit [![Gem Version](https://badge.fury.io/rb/charmkit.svg)](https://badge.fury.io/rb/charmkit)
2
+ > elegantly elegant charm authoring
6
3
 
7
4
  ## Installation
8
5
 
@@ -22,20 +19,73 @@ Or install it yourself as:
22
19
 
23
20
  ## Usage
24
21
 
25
- TODO: Write usage instructions here
22
+ In **hooks/install**:
23
+
24
+ ```
25
+ #!/bin/bash
26
+
27
+ apt-get update
28
+ apt-get install -qyf ruby
29
+ gem install bundler
30
+
31
+ bundle install --standalone
32
+ ```
33
+
34
+ In other hooks (eg. **hooks/config-changed**)
35
+
36
+ ```ruby
37
+ #!/usr/bin/env ruby
38
+ require_relative '../bundle/bundler/setup'
39
+ require 'charmkit'
40
+
41
+ package [
42
+ 'nginx-full', 'php-fpm', 'php-cgi', 'php-curl', 'php-gd', 'php-json',
43
+ 'php-mcrypt', 'php-readline', 'php-mbstring', 'php-xml'
44
+ ], :update_cache
45
+
46
+ hook_path = ENV['JUJU_CHARM_DIR']
47
+ app_path = config 'app_path'
48
+
49
+ mkdir app_path unless is_dir? app_path
50
+
51
+ release = config 'release'
52
+
53
+ case release
54
+ when "stable"
55
+ resource_path = resource 'stable-release'
56
+ when "development"
57
+ resource_path = resource 'development-release'
58
+ else
59
+ status :blocked, "Unknown release given #{release}"
60
+ exit 1
61
+ end
62
+
63
+ run "tar xf #{resource_path} -C #{app_path} --strip-components=1"
64
+
65
+ rm "#{app_path}/conf/install.php" unless !is_file? "#{app_path}/conf/install.php"
66
+ ```
26
67
 
27
68
  ## Development
28
69
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
70
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run
71
+ `rake spec` to run the tests. You can also run `bin/console` for an interactive
72
+ prompt that will allow you to experiment.
30
73
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
74
+ To install this gem onto your local machine, run `bundle exec rake install`. To
75
+ release a new version, update the version number in `version.rb`, and then run
76
+ `bundle exec rake release`, which will create a git tag for the version, push
77
+ git commits and tags, and push the `.gem` file
78
+ to [rubygems.org](https://rubygems.org).
32
79
 
33
80
  ## Contributing
34
81
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/charmkit. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
-
82
+ Bug reports and pull requests are welcome on GitHub at
83
+ https://github.com/charmkit/charmkit. This project is intended to be a safe,
84
+ welcoming space for collaboration, and contributors are expected to adhere to
85
+ the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
37
86
 
38
87
  ## License
39
88
 
40
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
89
+ The gem is available as open source under the terms of
90
+ the [MIT License](http://opensource.org/licenses/MIT).
41
91
 
data/lib/charmkit/fs.rb CHANGED
@@ -15,7 +15,11 @@ module Charmkit
15
15
  end
16
16
 
17
17
  def mkdir(path)
18
- FileUtils.mkdir_p path unless is_dir? path
18
+ FileUtils.mkdir_p path
19
+ end
20
+
21
+ def rm(path)
22
+ FileUtils.rm_rf(path, :force => true)
19
23
  end
20
24
  end
21
25
  end
@@ -1,3 +1,3 @@
1
1
  module Charmkit
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: charmkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Stokes