middleman-fjords 1.0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ .DS_Store
2
+ Gemfile.lock
3
+ tmp
4
+ .rbenv-*
5
+ .sass-cache
6
+ pkg
data/Gemfile ADDED
@@ -0,0 +1,26 @@
1
+ source :rubygems
2
+
3
+ git "git://github.com/middleman/middleman.git", :branch => "3.0-stable" do
4
+ # gem "middleman"
5
+ gem "middleman-core"
6
+ # gem "middleman-more"
7
+ end
8
+
9
+ gem "fjords", :path => '~/Sites/fjords/fjords-cli'
10
+ gem "fjords-client", :path => '~/Sites/fjords/fjords-client'
11
+
12
+ # Specify your gem's dependencies in middleman-blog.gemspec
13
+ gemspec
14
+
15
+ group :development do
16
+ gem "rake", "~> 0.9.2"
17
+ gem "rdoc", "~> 3.9"
18
+ gem "yard", "~> 0.8.0"
19
+ end
20
+
21
+ group :test do
22
+ gem "cucumber", "~> 1.2.0"
23
+ gem "fivemat"
24
+ gem "aruba", "~> 0.4.11"
25
+ gem "rspec", "~> 2.7"
26
+ end
data/Rakefile ADDED
@@ -0,0 +1,19 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'cucumber/rake/task'
5
+
6
+ Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
7
+ ENV["TEST"] = "true"
8
+ ENV["AUTOLOAD_SPROCKETS"] = "true"
9
+ t.cucumber_opts = "--color --tags ~@wip --strict --format #{ENV['CUCUMBER_FORMAT'] || 'Fivemat'}"
10
+ end
11
+
12
+ require 'rake/clean'
13
+
14
+ task :test => ["cucumber"]
15
+
16
+ desc "Build HTML documentation"
17
+ task :doc do
18
+ sh 'bundle exec yard'
19
+ end
@@ -0,0 +1,4 @@
1
+ PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
2
+ require "middleman-core"
3
+ require "middleman-core/step_definitions"
4
+ require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-pushit')
@@ -0,0 +1,23 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta http-equiv='X-UA-Compatible' content='IE=edge;chrome=1' />
6
+ </head>
7
+ <body>
8
+
9
+ <div id="main" role="main">
10
+ <p>Old <strong>Article</strong> Content<em>123</em></p>
11
+
12
+ <ul>
13
+ <li><em>one</em></li>
14
+ <li><em>two</em></li>
15
+ </ul>
16
+
17
+ <p>Okay</p>
18
+
19
+ <p>Moar</p>
20
+
21
+ </div>
22
+ </body>
23
+ </html>
@@ -0,0 +1,15 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta http-equiv='X-UA-Compatible' content='IE=edge;chrome=1' />
6
+ </head>
7
+ <body>
8
+
9
+ <div id="main" role="main">
10
+ Newer Article Content
11
+
12
+ Again2
13
+ </div>
14
+ </body>
15
+ </html>
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta http-equiv='X-UA-Compatible' content='IE=edge;chrome=1' />
6
+ </head>
7
+ <body>
8
+
9
+ <div id="main" role="main">
10
+
11
+ </div>
12
+ </body>
13
+ </html>
@@ -0,0 +1,4 @@
1
+ activate :fjords do |config|
2
+ config.username = "tdreyno2"
3
+ config.password = "dakota1"
4
+ end
@@ -0,0 +1,18 @@
1
+ ---
2
+ title: New Article
3
+ tags: one, two, three
4
+ test: key
5
+ published: false
6
+ blog_editor_id: 3
7
+ ---
8
+
9
+ <p>Old <strong>Article</strong> Content<em>123</em></p>
10
+
11
+ <ul>
12
+ <li><em>one</em></li>
13
+ <li><em>two</em></li>
14
+ </ul>
15
+
16
+ <p>Okay</p>
17
+
18
+ <p>Moar</p>
@@ -0,0 +1,9 @@
1
+ ---
2
+ title: Newer Article
3
+ date: 2011-01-01
4
+ blog_editor_id: 2
5
+ ---
6
+
7
+ Newer Article Content
8
+
9
+ Again2
File without changes
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta http-equiv='X-UA-Compatible' content='IE=edge;chrome=1' />
6
+ </head>
7
+ <body>
8
+
9
+ <div id="main" role="main">
10
+ <%= yield %>
11
+ </div>
12
+ </body>
13
+ </html>
@@ -0,0 +1,7 @@
1
+ require "middleman-core"
2
+ require "middleman-fjords/commands/fjords"
3
+
4
+ Middleman::Extensions.register(:fjords) do
5
+ require "middleman-fjords/extension"
6
+ Middleman::Fjords
7
+ end
@@ -0,0 +1,66 @@
1
+ require 'middleman-core/cli'
2
+ require 'fjords-client'
3
+
4
+ module Middleman
5
+ module Cli
6
+ # This class provides an "article" command for the middleman CLI.
7
+ class Fjords < Thor
8
+ # include Thor::Actions
9
+
10
+ check_unknown_options!
11
+
12
+ namespace :fjords
13
+
14
+ # Tell Thor to exit with a nonzero exit code on failure
15
+ def self.exit_on_failure?
16
+ true
17
+ end
18
+
19
+ desc "fjords [options]", "Deploy to Fjords.cc"
20
+ method_option :rebuild, :type => :boolean, :default => false, :desc => 'Rebuild project before deploying'
21
+ def fjords
22
+ shared_instance = ::Middleman::Application.server.inst
23
+ opts = shared_instance.fjords_options
24
+
25
+ if !::Fjords::Client.logged_in?
26
+ if !opts.username || !opts.password
27
+ puts "Username and password are required"
28
+ exit(1)
29
+ end
30
+
31
+ ::Fjords::Client.login(opts.username, opts.password)
32
+ end
33
+
34
+ if options["rebuild"] || opts.rebuild
35
+ puts "Rebuilding..."
36
+ puts `bundle exec middleman build`
37
+ end
38
+
39
+ # puts "Deploying..."
40
+ cmd = "bundle exec fjords push"
41
+ cmd << %Q{ --path="#{shared_instance.build_dir}" --no-progress}
42
+ if opts.no_zip
43
+ cmd << %Q{ --no-zip}
44
+ end
45
+ if opts.domain
46
+ cmd << %Q{ --domain="#{opts.domain}"}
47
+ cmd << %Q{ --overwrite}
48
+ end
49
+ # cmd << %Q{ --domain-file="#{opts.domain_file}"} if opts.domain_file
50
+
51
+ require 'pty'
52
+ begin
53
+ PTY.spawn(cmd) do |stdin, stdout, pid|
54
+ begin
55
+ stdin.each { |line| print line }
56
+ rescue Errno::EIO
57
+ end
58
+ end
59
+ rescue PTY::ChildExited
60
+ # puts "The child process exited!"
61
+ end
62
+
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,42 @@
1
+ # Blog Editor extension
2
+ module Middleman::Fjords
3
+
4
+ class Options
5
+ KEYS = [
6
+ :domain,
7
+ :domain_file,
8
+ :rebuild,
9
+ :no_zip,
10
+ :username,
11
+ :password
12
+ ]
13
+
14
+ KEYS.each do |name|
15
+ attr_accessor name
16
+ end
17
+
18
+ def initialize(options={})
19
+ options.each do |k,v|
20
+ self.send(:"#{k}=", v)
21
+ end
22
+ end
23
+ end
24
+
25
+ # Setup extension
26
+ class << self
27
+
28
+ # Once registered
29
+ def registered(app, options_hash={}, &block)
30
+ options = Options.new(options_hash)
31
+ yield options if block_given?
32
+
33
+ options.rebuild ||= false
34
+ options.domain ||= nil
35
+ options.domain_file ||= nil
36
+ options.no_zip ||= false
37
+
38
+ app.set :fjords_options, options
39
+ end
40
+ alias :included :registered
41
+ end
42
+ end
@@ -0,0 +1,5 @@
1
+ module Middleman
2
+ module Fjords
3
+ VERSION = "1.0.1.1"
4
+ end
5
+ end
@@ -0,0 +1 @@
1
+ require "middleman-fjords"
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "middleman-fjords/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "middleman-fjords"
7
+ s.version = Middleman::Fjords::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Thomas Reynolds"]
10
+ s.email = ["me@tdreyno.com"]
11
+ s.homepage = "http://fjords.awardwinningfjords.com/"
12
+ s.summary = %q{Push-button deploy}
13
+ s.description = %q{Push-button deploy}
14
+
15
+ s.rubyforge_project = "middleman-fjords"
16
+
17
+ s.files = `git ls-files -z`.split("\0")
18
+ s.test_files = `git ls-files -z -- {fixtures,features}/*`.split("\0")
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_dependency("middleman-core", [">= 3.0.1"])
22
+ s.add_dependency("fjords", "1.0.1")
23
+ end
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: middleman-fjords
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Thomas Reynolds
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-02-09 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: middleman-core
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 3.0.1
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 3.0.1
30
+ - !ruby/object:Gem::Dependency
31
+ name: fjords
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - '='
36
+ - !ruby/object:Gem::Version
37
+ version: 1.0.1
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - '='
44
+ - !ruby/object:Gem::Version
45
+ version: 1.0.1
46
+ description: Push-button deploy
47
+ email:
48
+ - me@tdreyno.com
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - .gitignore
54
+ - Gemfile
55
+ - Rakefile
56
+ - features/support/env.rb
57
+ - fixtures/blog-app/build/2010/12/13/old-article.html
58
+ - fixtures/blog-app/build/2011/01/01/new-article.html
59
+ - fixtures/blog-app/build/index.html
60
+ - fixtures/blog-app/config.rb
61
+ - fixtures/blog-app/source/2010/12/13/old-article.html.erb
62
+ - fixtures/blog-app/source/2011/01/01/new-article.html.erb
63
+ - fixtures/blog-app/source/index.html.erb
64
+ - fixtures/blog-app/source/layout.erb
65
+ - lib/middleman-fjords.rb
66
+ - lib/middleman-fjords/commands/fjords.rb
67
+ - lib/middleman-fjords/extension.rb
68
+ - lib/middleman-fjords/version.rb
69
+ - lib/middleman_extension.rb
70
+ - middleman-fjords.gemspec
71
+ homepage: http://fjords.awardwinningfjords.com/
72
+ licenses: []
73
+ post_install_message:
74
+ rdoc_options: []
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ none: false
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ segments:
84
+ - 0
85
+ hash: -2529493793543591797
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ none: false
88
+ requirements:
89
+ - - ! '>='
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ segments:
93
+ - 0
94
+ hash: -2529493793543591797
95
+ requirements: []
96
+ rubyforge_project: middleman-fjords
97
+ rubygems_version: 1.8.23
98
+ signing_key:
99
+ specification_version: 3
100
+ summary: Push-button deploy
101
+ test_files:
102
+ - features/support/env.rb
103
+ - fixtures/blog-app/build/2010/12/13/old-article.html
104
+ - fixtures/blog-app/build/2011/01/01/new-article.html
105
+ - fixtures/blog-app/build/index.html
106
+ - fixtures/blog-app/config.rb
107
+ - fixtures/blog-app/source/2010/12/13/old-article.html.erb
108
+ - fixtures/blog-app/source/2011/01/01/new-article.html.erb
109
+ - fixtures/blog-app/source/index.html.erb
110
+ - fixtures/blog-app/source/layout.erb
111
+ has_rdoc: