pandoras_box 0.0.2 → 0.0.3

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5a284eeb42af6ecb27d5096673fbca269c15693
4
- data.tar.gz: eadf81e590e3c78455d75498dfe15f449849c608
3
+ metadata.gz: 6886e99dd63f1f02f489b5ebbec644a1a5120d46
4
+ data.tar.gz: 7fa3b0dbbc8a4848ea07eb07a78234c75dfc3288
5
5
  SHA512:
6
- metadata.gz: 1bf4866e5acd0f2b7f74a6fb996346e61a29d485d846435c3c76a5f6b003871cca183d8e541a4619ce83c65db15961192b8f16ff80c3c77ffb46c77bfbab8562
7
- data.tar.gz: 1729ab4c308b4839150ba8bca136b9c9e9d3a994d0f59a48d56d32e4826fcd29eb01bd975fa6cf1a9fe01e03053e5d74919c5d8ed9769e00725186048c6441f1
6
+ metadata.gz: 83b724c872fa808176d0f5deafd8c159f856fab102980ddf98e3651869542effc203109569d3d330dbcb950d01e6010122d95ff96d81289e98709e75a7a6db13
7
+ data.tar.gz: c039fe679c2b72b811be0c5fedf5faedc58b53b5dc10ea317aeeb2ab6ed18dc4efa57e1c3d2232eea574ff6a7653eeaacda06ee117c93c893369055975d40352
data/README.md CHANGED
@@ -2,3 +2,53 @@ PandorasBox
2
2
  ===========
3
3
 
4
4
  Dotfiles are like opening Pandora's Box. Stop making me do stuff to get things to work.
5
+
6
+
7
+ ## Install
8
+
9
+ `gem install pandoras_box`
10
+
11
+ ## Usage
12
+
13
+ If you look at the help command `box help` you can find command usage.
14
+
15
+ ## Creating a box
16
+
17
+ Boxes are defined in ruby files. The folder structure is this:
18
+
19
+ .
20
+ ├── LICENSE
21
+ ├── README.md
22
+ ├── Simple
23
+ │   └── test.symlink
24
+ ├── Test
25
+ │   └── test1234.symlink
26
+ └── boxes
27
+ └── test_box.rb
28
+
29
+ boxes/ is where you define the ruby files for the boxes. The boxes themselves go in a folder named the same as the box's name (this can be changed).
30
+
31
+ Anything ending in .symlink will be symlinked with ~/.#{file}
32
+
33
+ Here's an example box:
34
+
35
+ ``` ruby
36
+ require 'pandoras_box/boxes/box'
37
+
38
+ class BaconBox < Box
39
+ @@name = 'Bacon'
40
+ @@description = 'Epicness in a box'
41
+ @@download_repo = 'epicusername/epicrepo'
42
+ end
43
+ ```
44
+
45
+ The default boxes can be found in the repo.
46
+
47
+ Custom install steps can be added by overriding `custom_install_steps` in your box class.
48
+
49
+ To then add the box, run `box add epicusername/epicrepo` and then run `box install`.
50
+
51
+
52
+ ## I broke it
53
+
54
+ Create an issue.
@@ -16,6 +16,17 @@ class Box
16
16
  attr_accessor :download_repo
17
17
  attr_accessor :download_directory
18
18
 
19
+ def install
20
+ FileManager.generate_basic_folders
21
+ FileManager.current_box = @name
22
+ FileManager.download_box(@download_repo)
23
+ custom_install_steps
24
+ FileManager.symlink_all(@name, @download_repo)
25
+ end
26
+
27
+ def custom_install_steps
28
+ end
29
+
19
30
  def initialize
20
31
  @download_repo = @@download_repo
21
32
  @name = @@name
@@ -0,0 +1,19 @@
1
+ require 'pandoras_box/box'
2
+ require 'fileutils'
3
+
4
+ class BashImportBox < Box
5
+ @@name = 'default_bash2zsh'
6
+ @@description = 'Bash -> zsh'
7
+ @@download_repo = 'hunterboerner/Boxes'
8
+
9
+ def custom_install_steps
10
+ FileManager.generate_from_array(['zsh/modules/'])
11
+ %w(bashrc bash_profile).each do |file|
12
+ puts "Copying #{file} to modules"
13
+ dest = "#{ENV['HOME']}/.pandorasbox/zsh/modules/#{file}.zsh"
14
+ FileUtils.mkpath(File.dirname(dest))
15
+ FileUtils.copy("#{ENV['HOME']}/.#{file}", dest)
16
+ end
17
+ `chsh -s /bin/zsh`
18
+ end
19
+ end
@@ -1,19 +1,7 @@
1
1
  require 'pandoras_box/box'
2
- require 'pandoras_box/file_manager'
3
2
 
4
3
  class BasicBox < Box
5
4
  @@name = 'default_Basic'
6
5
  @@description = 'Simply turn your current dotfiles into modules, nothing else.'
7
6
  @@download_repo = 'hunterboerner/Boxes'
8
-
9
- def install
10
- FileManager.generate_basic_folders
11
- FileManager.current_box = @name
12
- FileManager.download_box(@download_repo)
13
- custom_install_steps
14
- FileManager.symlink_all(@name, @download_repo)
15
- end
16
-
17
- def custom_install_steps
18
- end
19
7
  end
@@ -1,6 +1,6 @@
1
- require 'pandoras_box/boxes/basic_box'
1
+ require 'pandoras_box/box'
2
2
 
3
- class SimpleBox < BasicBox
3
+ class SimpleBox < Box
4
4
  @@name = 'default_Simple'
5
5
  @@description = 'Add some of the important things in such as current git branch.'
6
6
  @@download_repo = 'hunterboerner/Boxes'
@@ -3,7 +3,9 @@ Example usage:
3
3
  box install
4
4
  box import [file] [save directory]
5
5
  box current
6
+ box add [GitHub user]/[repo]
6
7
 
7
8
  Examples:
8
9
  box import zshrc zsh # Will move .zshrc to the current box's zsh folder
10
+ box add hunterboerner/Boxes
9
11
  EOS
@@ -1,3 +1,3 @@
1
1
  class PandorasBox
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pandoras_box
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Theron Boerner
@@ -34,6 +34,7 @@ extra_rdoc_files: []
34
34
  files:
35
35
  - bin/box
36
36
  - lib/pandoras_box/box.rb
37
+ - lib/pandoras_box/boxes/bash_import_box.rb
37
38
  - lib/pandoras_box/boxes/basic_box.rb
38
39
  - lib/pandoras_box/boxes/simple_box.rb
39
40
  - lib/pandoras_box/cli.rb
@@ -65,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
66
  version: '0'
66
67
  requirements: []
67
68
  rubyforge_project:
68
- rubygems_version: 2.1.10
69
+ rubygems_version: 2.1.11
69
70
  signing_key:
70
71
  specification_version: 4
71
72
  summary: Dotfiles are like opening Pandora's Box. Stop making me do stuff to get things