middleman-bitballoon 0.1.2

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 64ba58cfebfc82746e3ddf05b9b4bb677a31787f
4
+ data.tar.gz: 8a58eef4fcfa6ead9c83c8c1ddaec71417846ac5
5
+ SHA512:
6
+ metadata.gz: 44e3b252ccca4af79d7073560ff234c04d2447ec5da859c78001ed5433daf12521a3a3e0cd1cfd548ab09182e90c39586d81bc3145cd5cdaf15300f5720efe5a
7
+ data.tar.gz: 0a4dcf2f00707f6f2f2f0e825d080aa7e7fd19cf4d2107729fa0e2d381ac181cc999a20be7ca16d028fec480a50828d634ccc8f0cc04fd3152494f46469f9581
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in middleman-bitballoon.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Mathias Biilmann Christensen
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,39 @@
1
+ # Middleman::Bitballoon
2
+
3
+ Deploys a [Middleman](http://middlemanapp.com/) built site to BitBalloon
4
+
5
+ ## Installation
6
+
7
+ Add this to the Gemfile of the repository of your middleman site:
8
+
9
+ gem 'middleman-bitballoon'
10
+
11
+ And then execute:
12
+
13
+ $ bundle install
14
+
15
+ ## Usage
16
+
17
+ $ middleman deploy [--build-before]
18
+
19
+ ## Configuration
20
+
21
+ Activate and configure middleman-bitballoon in your config.rb:
22
+
23
+ ```ruby
24
+ activate :bitballoon do |bitballoon|
25
+ bitballoon.token = ENV["BB_TOKEN"]
26
+ bitballoon.site = "my-bitballoon-site.bitballoon.com"
27
+
28
+ # Optional: always run a build before deploying
29
+ bitballoon.build_before = true
30
+ end
31
+ ```
32
+
33
+ ## Contributing
34
+
35
+ 1. Fork it ( http://github.com/bitballoon/middleman-bitballoon/fork )
36
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
37
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
38
+ 4. Push to the branch (`git push origin my-new-feature`)
39
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,8 @@
1
+ require "middleman-bitballoon/version"
2
+ require "middleman-core"
3
+ require "middleman-bitballoon/commands"
4
+
5
+ ::Middleman::Extensions.register(:bitballoon) do
6
+ require "middleman-bitballoon/extension"
7
+ ::Middleman::BitBalloon
8
+ end
@@ -0,0 +1,92 @@
1
+ require "bitballoon"
2
+ require "middleman-core/cli"
3
+ require "middleman-bitballoon/extension"
4
+
5
+ module Middleman
6
+ module Cli
7
+
8
+ # This class provides a "deploy" command for the middleman CLI.
9
+ class Deploy < Thor
10
+ include Thor::Actions
11
+
12
+ check_unknown_options!
13
+
14
+ namespace :deploy
15
+
16
+ # Tell Thor to exit with a nonzero exit code on failure
17
+ def self.exit_on_failure?
18
+ true
19
+ end
20
+
21
+ desc "deploy [options]", "Deploy a middleman built site with BitBalloon"
22
+ method_option "build_before",
23
+ :type => :boolean,
24
+ :aliases => "-b",
25
+ :desc => "Run `middleman build` before the deploy step"
26
+ def deploy
27
+ build_before(options)
28
+ process
29
+ end
30
+
31
+ protected
32
+
33
+ def build_before(options={})
34
+ build_enabled = options.fetch('build_before', self.deploy_options.build_before)
35
+
36
+ if build_enabled
37
+ # http://forum.middlemanapp.com/t/problem-with-the-build-task-in-an-extension
38
+ run('middleman build') || exit(1)
39
+ end
40
+ end
41
+
42
+ def print_usage_and_die(message)
43
+ raise Error, <<-MSG
44
+ ERROR: #{message}
45
+
46
+ Configure the bitballoon extension in config.rb:
47
+
48
+ activate :bitballoon do |bitballoon|
49
+ bitballoon.token = ENV['BB_TOKEN']
50
+ bitballoon.site = "mysite.bitballoon.com"
51
+ end
52
+ MSG
53
+ end
54
+
55
+ def process
56
+ puts "Deploying to BitBalloon site #{deploy_options.site}"
57
+ server_instance = ::Middleman::Application.server.inst
58
+
59
+ client = ::BitBalloon::Client.new(:access_token => deploy_options.token)
60
+ client.sites.get(deploy_options.site).tap do |site|
61
+ site.update(:dir => server_instance.build_dir)
62
+ puts "Waiting for BitBalloon to Process the deploy"
63
+ site.wait_for_ready
64
+ puts "Deploy ready at #{site.url}"
65
+ end
66
+ end
67
+
68
+ def deploy_options
69
+ options = nil
70
+
71
+ begin
72
+ options = ::Middleman::Application.server.inst.options
73
+ rescue NoMethodError
74
+ print_usage_and_die "You need to activate the bitballoon extension in config.rb."
75
+ end
76
+
77
+ unless options.token
78
+ print_usage_and_die "The bitballoon extension requires you to set a token."
79
+ end
80
+
81
+ unless options.site
82
+ print_usage_and_die "The bitballoon extension requires you to set a site."
83
+ end
84
+
85
+ options
86
+ end
87
+ end
88
+
89
+ # Alias "d" to "deploy"
90
+ Base.map({ "d" => "deploy" })
91
+ end
92
+ end
@@ -0,0 +1,30 @@
1
+ module Middleman
2
+ module BitBalloon
3
+ class Options < Struct.new(:token, :site, :build_before); end
4
+
5
+ class << self
6
+
7
+ def options
8
+ @@options
9
+ end
10
+
11
+ def registered(app, options_hash={}, &block)
12
+ options = Options.new(options_hash)
13
+
14
+ yield options if block_given?
15
+
16
+ @@options = options
17
+
18
+ app.send :include, Helpers
19
+ end
20
+
21
+ alias :included :registered
22
+ end
23
+
24
+ module Helpers
25
+ def options
26
+ ::Middleman::BitBalloon.options
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,5 @@
1
+ module Middleman
2
+ module BitBalloon
3
+ VERSION = "0.1.2"
4
+ end
5
+ end
@@ -0,0 +1 @@
1
+ require "middleman-bitballoon"
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'middleman-bitballoon/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "middleman-bitballoon"
8
+ spec.version = Middleman::BitBalloon::VERSION
9
+ spec.authors = ["Mathias Biilmann Christensen"]
10
+ spec.email = ["mathias@bitballoon.com"]
11
+ spec.summary = %q{Deploy MiddleMan built sites to BitBalloon}
12
+ spec.homepage = ""
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_dependency "bitballoon"
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.5"
23
+ spec.add_development_dependency "rake"
24
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: middleman-bitballoon
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - Mathias Biilmann Christensen
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bitballoon
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.5'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.5'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description:
56
+ email:
57
+ - mathias@bitballoon.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - lib/middleman-bitballoon.rb
68
+ - lib/middleman-bitballoon/commands.rb
69
+ - lib/middleman-bitballoon/extension.rb
70
+ - lib/middleman-bitballoon/version.rb
71
+ - lib/middleman_extension.rb
72
+ - middleman-bitballoon.gemspec
73
+ homepage: ''
74
+ licenses:
75
+ - MIT
76
+ metadata: {}
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.2.2
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: Deploy MiddleMan built sites to BitBalloon
97
+ test_files: []