slate-installer 1.0.0 → 1.1.0

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzA4YjRlZTE3OTUyMGVlZjQ0ZWI2NjM0M2YyYjRlYWRlZTk3MTJjZg==
4
+ ZjUzNDk1ZDgyMmNjZWZmNDEyMzdkODVlMzgwZWZlNDVmM2JlZTc2ZA==
5
5
  data.tar.gz: !binary |-
6
- ZmEyZGI5NjcyM2RmMTllZjcxMzc1YzFjMWRlMGQyNmQ2OTgyNzJhMA==
6
+ YjY3MjBiZGExM2RhYjhjNGU2MmE5ZTgzMTY3ZjllYjM1ZWJiNzg3Yw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NmRjMGY5NWYyMDJmZTJjNGM1ODMxZjJkZjg1ZDZhOTU4MDI3OTcyYzAzYjg4
10
- N2Q1NGQ0NTNhM2M0ZGRlMDU3MzA3NTRmNDgyYTNkMGNjMDZjMDM0YmY4OGY2
11
- MTVhY2ZhYzhjMTdiNGM4MDk4NjY1NzhiNTljOTVhZGIyNDU0ZDQ=
9
+ YmZhNDMzNThhYTBiZTZiZjg0MjAxOThjNTNmZjM5OGI4MjFiOWVkMjM0OGJj
10
+ MDU3Y2RjOGQ1YWQ3YzkwNTQ4YjdlNzg2MjlkYzFkODdmMjU1M2VlYWQ0Mzhm
11
+ ZTc3MGIyZDg3ZDc0NjE1NjllYjQyNDg1OTkyNTc5MTVmNGEwM2I=
12
12
  data.tar.gz: !binary |-
13
- MDEwYjU0MWY0ODcyOGZjNTM4MDMzYmRlM2ZhZjI1MDExNDdlZmNkMDk2NDg0
14
- NDM2N2YyYTE3ODc3ODY1N2M2OGI1YTFmNDc4YWViZjhkNzhiYmM2MDBhNmY1
15
- MDZmNzI5YWNkOWRmZTUxNDFkZDFjYjBmZjdkMjcwNTM1ZGJmYjM=
13
+ ZTRhYzgxZTQ0Y2U1MjJlMjI3ZjY1NDRiNzNjYWQ4ZTg3Y2QyYjYwMDdkNjVk
14
+ YjJjYjcxMDJmODczYjQ1ZWI5ZTViOTkwMmNlMWQ4YmY5ODJiZTZkZWJiMjZi
15
+ MTMxYzEyYWRjYzNhOTYxMmZlM2MxNTRhOWY1ZWE0ZGVkMTBiNTM=
@@ -0,0 +1,15 @@
1
+ # Changelog
2
+
3
+ ## Version 1.1.0
4
+
5
+ *October 14, 2016*
6
+
7
+ **Features**
8
+
9
+ - Added an optional `-l, [--logo=LOGO]` option to specify a path to the custom logo file to use in the slate install
10
+
11
+ ## Version 1.0.0
12
+
13
+ *September 29, 2016*
14
+
15
+ Initial release
data/README.md CHANGED
@@ -52,6 +52,12 @@ To install slate into your docs folder run
52
52
  $ slate-installer install
53
53
  ```
54
54
 
55
+ You can optionally specify the path to a custom logo to have that overwrite the slate logo during install
56
+
57
+ ```shell
58
+ $ slate-installer install -l path/to/logo.png
59
+ ```
60
+
55
61
  ## Development
56
62
 
57
63
  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.
@@ -16,14 +16,50 @@ module Slate
16
16
  end
17
17
 
18
18
  desc "install", "creates a docs folder and installs latest slate into it"
19
+ method_option :logo, :type => :string, :aliases => "-l", :desc => "path to custom logo file", :lazy_default => ""
19
20
  def install
21
+ if options[:logo]
22
+ logo = determine_logo_path(options[:logo])
23
+ end
24
+
20
25
  Dir.mktmpdir("slate-src-") do |tmpdir|
21
26
  output, _status = Open3.capture2e("git", "clone", "--depth", "1", "--progress", "https://github.com/lord/slate.git", tmpdir)
22
27
  puts output
28
+
29
+ if logo
30
+ slate_logo_path = File.join(tmpdir, "source", "images", "logo.png")
31
+ logo_mode = File.stat(slate_logo_path).mode
32
+ create_file slate_logo_path, File.binread(logo), {:force => true}
33
+ chmod slate_logo_path, logo_mode, {}
34
+ end
35
+
23
36
  directory Pathname.new(tmpdir).basename, "docs", \
24
37
  mode: :preserve, recursive: true, exclude_pattern: /(?:\.git(?:hub)?\/)|(?:\.travis)/
25
38
  end
26
39
  end
40
+
41
+ private
42
+
43
+ def self.exit_on_failure?
44
+ true
45
+ end
46
+
47
+ def determine_logo_path(logo)
48
+ logo = String(logo)
49
+ if logo.empty?
50
+ logo = ask("Enter the path to the logo file:", :path => true)
51
+ end
52
+
53
+ if logo.empty?
54
+ raise ::Thor::MalformattedArgumentError, "A logo path must be provided when using the logo option"
55
+ end
56
+
57
+ unless File.file?(File.expand_path(logo))
58
+ raise ::Thor::MalformattedArgumentError, "The logo path provided is not a file"
59
+ end
60
+
61
+ logo
62
+ end
27
63
  end
28
64
  end
29
65
  end
@@ -1,5 +1,5 @@
1
1
  module Slate
2
2
  module Installer
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Kevin Glowacz"]
10
10
  spec.email = ["kevin@glowacz.info"]
11
11
 
12
- spec.summary = "Easily slate powered docs to your app"
12
+ spec.summary = "Easily add slate powered docs to your app"
13
13
  spec.description = "This provides a utility to add and update your docs " \
14
14
  "folder with the latest slate source"
15
15
  spec.homepage = "https://github.com/kjg/slate-installer"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slate-installer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Glowacz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-29 00:00:00.000000000 Z
11
+ date: 2016-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -78,6 +78,7 @@ files:
78
78
  - .gitignore
79
79
  - .rspec
80
80
  - .travis.yml
81
+ - CHANGELOG.md
81
82
  - CODE_OF_CONDUCT.md
82
83
  - Gemfile
83
84
  - LICENSE.txt
@@ -114,5 +115,5 @@ rubyforge_project:
114
115
  rubygems_version: 2.4.5
115
116
  signing_key:
116
117
  specification_version: 4
117
- summary: Easily slate powered docs to your app
118
+ summary: Easily add slate powered docs to your app
118
119
  test_files: []