ghost-manager 0.0.1

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 096796bd5a2c1a9f4b543e3e00e790248bf3f02a
4
+ data.tar.gz: a19cbc4b5e017adf093d735ed40ad7850951bbe7
5
+ SHA512:
6
+ metadata.gz: e6de91fd33ef1342fcf2c1229ec02b757ff08881e55bddbd66fee5f5034eccead3b4f41fa4805436f70fad3f51257a9b1538fe5dd72539cc4024ebffa511fc57
7
+ data.tar.gz: a9d7ac27989e7a4846899bcc1bd8a8461d5baa86024aaad4dc5f210679c2fff6dd8986520043d9de89470a8be31b32372c5e036a5a37c92039f5530b2446b412
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.3
4
+ before_install: gem install bundler -v 1.10.6
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ghost-manager.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Joshua Tyree
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # Ghost Manager
2
+
3
+ Ghost Manager is a Ruby command line gem created to simply the process of installing, updating, and theming Ghost, a popular blogging platform. https://ghost.org
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'ghost-manager'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install ghost-manager
20
+
21
+ ## Usage
22
+
23
+ Using Ghost Manager is dead simple. Using the "ghost" command, select from the menu and continue with on-screen instructions.
24
+
25
+ Console:
26
+ ```
27
+ $joshuat ghost
28
+ Welcome to Ghost Manager, created by Create the Bridge
29
+
30
+ 1. Install Ghost
31
+ 2. Update Ghost Install
32
+ 3. Generate Theme
33
+ What do you want to do?
34
+ ```
35
+
36
+ It's important to note that you must have git and npm installed for this gem to function properly.
37
+
38
+ ## Contributing
39
+
40
+ Bug reports and pull requests are welcome on GitHub at https://github.com/CreateTheBridge/ghost-manager.
41
+
42
+
43
+ ## License
44
+
45
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "ghost/manager"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/ghost ADDED
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'string'
4
+ require 'ghost/manager'
5
+ require 'highline/import'
6
+
7
+
8
+ puts ""
9
+ say "<%= color('Welcome to Ghost Manager, created by Create the Bridge', :green, :bold) %>"
10
+ puts ""
11
+
12
+ choose do |menu|
13
+ menu.prompt = "What do you want to do? "
14
+ menu.choice('Install Ghost') {
15
+ dir = ask "Where would you like to install Ghost? (default #{Dir.home}/Applications/Ghost)"
16
+ dir = "#{Dir.home}/Applications/Ghost" if dir.blank?
17
+ installer = Ghost::Manager::Installer.new dir
18
+ installer.install
19
+ }
20
+
21
+ menu.choice('Update Ghost Install') {
22
+ ghost_install = ask "Please enter the path to your ghost installation: (default #{Dir.home}/Applications/Ghost) "
23
+ ghost_install = "#{Dir.home}/Applications/Ghost" if ghost_install.blank?
24
+ installer = Ghost::Manager::Installer.new ghost_install
25
+ installer.update_install
26
+ }
27
+
28
+ menu.choice('Generate Theme') {
29
+ puts ""
30
+ say "<%= color('Sorry theme generation is not yet supported. We will add support for this option when our Yeoman generator has been released.', :red, :bold) %>"
31
+ # ghost_install = ask "Please enter the path to your ghost installation: (default #{Dir.home}/Applications/Ghost) "
32
+ # ghost_install = "#{Dir.home}/Applications/Ghost" if ghost_install.blank?
33
+ # installer = Ghost::Manager::Installer.new ghost_install
34
+ # installer.generate_theme
35
+ }
36
+ end
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -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 'ghost/manager/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ghost-manager"
8
+ spec.version = Ghost::Manager::VERSION
9
+ spec.authors = ["Joshua Tyree"]
10
+ spec.email = ["joshuat@createthebridge.com"]
11
+
12
+ spec.summary = %q{Ghost manager is a ruby command line utility to manager Ghost installation and theme development}
13
+ spec.description = %q{Ghost manager is a ruby command line utility to manager Ghost installation and theme development}
14
+ spec.homepage = "https://github.com/CreateTheBridge/ghost-manager"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.executables = ["ghost"]
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.10"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "highline", "~> 1.7.3"
24
+ end
@@ -0,0 +1,5 @@
1
+ module Ghost
2
+ module Manager
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,65 @@
1
+ require "ghost/manager/version"
2
+ require "highline/import"
3
+
4
+ module Ghost
5
+ module Manager
6
+
7
+ class Installer
8
+ attr_accessor :install_directory
9
+
10
+
11
+ def initialize install_path
12
+ self.install_directory = File.expand_path install_path
13
+ end
14
+
15
+ def install
16
+ # Make sure directory exists
17
+ if Dir.exists? install_directory
18
+ say "<%= color('Directory exists, removing directory and recreating...', :bold, :yellow) %>"
19
+ system 'rm', '-rf', install_directory
20
+ end
21
+
22
+ # Create the directory
23
+ system 'mkdir', '-p', install_directory
24
+
25
+ say "<%= color('Cloning latest ghost version', :bold, :light_blue) %>"
26
+ puts ""
27
+
28
+ # Clone the latest version of ghost from github
29
+ system "cd #{install_directory} && git clone https://github.com/TryGhost/Ghost.git ."
30
+
31
+ puts ""
32
+ say "<%= color('Installing node modules', :bold, :light_blue) %>"
33
+ puts ""
34
+ # Install packages
35
+ system "cd #{install_directory} && npm install"
36
+ end
37
+
38
+ def update_install
39
+ say "<%= color('Updating ghost install...', :light_blue, :bold) %>"
40
+ puts ""
41
+
42
+ system "cd #{install_directory} && git stash && git pull && git stash pop"
43
+
44
+ puts ""
45
+ say "<%= color('Installing new node modules...', :light_blue, :bold) %>"
46
+ puts ""
47
+
48
+ system "cd #{install_directory} && npm install"
49
+ end
50
+
51
+
52
+ def generate_theme
53
+ # say "<%= color('Sorry, this does not quite work yet', :red, :bold) %>"
54
+ # Make sure Yeoman is ready to roll
55
+ # say "<%= color('Installing Yeoman...', :light_blue, :bold) %>"
56
+ # system "npm install -g yo bower grunt-cli gulp"
57
+
58
+
59
+
60
+ end
61
+
62
+ end
63
+
64
+ end
65
+ end
data/lib/string.rb ADDED
@@ -0,0 +1,5 @@
1
+ class String
2
+ def blank?
3
+ self !~ /[^[:space:]]/
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,102 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ghost-manager
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Joshua Tyree
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-09-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: highline
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 1.7.3
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 1.7.3
55
+ description: Ghost manager is a ruby command line utility to manager Ghost installation
56
+ and theme development
57
+ email:
58
+ - joshuat@createthebridge.com
59
+ executables:
60
+ - ghost
61
+ extensions: []
62
+ extra_rdoc_files: []
63
+ files:
64
+ - ".gitignore"
65
+ - ".travis.yml"
66
+ - Gemfile
67
+ - LICENSE.txt
68
+ - README.md
69
+ - Rakefile
70
+ - bin/console
71
+ - bin/ghost
72
+ - bin/setup
73
+ - ghost-manager.gemspec
74
+ - lib/ghost/manager.rb
75
+ - lib/ghost/manager/version.rb
76
+ - lib/string.rb
77
+ homepage: https://github.com/CreateTheBridge/ghost-manager
78
+ licenses:
79
+ - MIT
80
+ metadata: {}
81
+ post_install_message:
82
+ rdoc_options: []
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ requirements: []
96
+ rubyforge_project:
97
+ rubygems_version: 2.2.2
98
+ signing_key:
99
+ specification_version: 4
100
+ summary: Ghost manager is a ruby command line utility to manager Ghost installation
101
+ and theme development
102
+ test_files: []