devinator 0.0.1 → 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
  SHA256:
3
- metadata.gz: 046f88a18615ff14000b6152870bc84c8e8f7eedfd827a9c8a24d1c001f5fb9a
4
- data.tar.gz: d22ff6f57a13d3c6166cc61665f26bd40f3da09c4af11e1aa8bb37ce043c262b
3
+ metadata.gz: 849893f1832cf84799047935f72eeaedc26a389668d5ef5f9e4727aed2493896
4
+ data.tar.gz: b758be13ae17fb04700bcdd2bafd5828d3864f1e006b023b18408bfd753169f1
5
5
  SHA512:
6
- metadata.gz: 8df565e8abfe627a0092227af9d393242c5e906bc85279ea5ff09147e5a64a3e98c81d5d7b7b17776058df9b486fbdd8a08bf9e7e7ea6d19f6696fc98538e55d
7
- data.tar.gz: 14f6a8f20a1109135bf49acea9f5139a51524efc3828e9124445af3067bc78fbdeb216a94cc93a25ef9d71cd09af3ee70c6b80a3ee639275f686079489746a2f
6
+ metadata.gz: b29bb12d118f1cbd152cb54fc125d02f446a8b621681639de34a125d21da0edee73181ab3faf7d7c867c70a0f78c378a13079ff36f6c7933dd47207715952b04
7
+ data.tar.gz: 710b0d2463d0075bf2e0d1353726782be8e1d4e3cccbbf63e2b859b4a34c248c2b9dab250a6c19675ac7829e712fe35b8cc11cb03000b4f440bf0f5fc70e4b6a
data/Gemfile CHANGED
@@ -1,5 +1,5 @@
1
1
  source "https://rubygems.org" do
2
- gem "tty-command"
2
+ gemspec
3
3
 
4
4
  group :development do
5
5
  gem "standardrb"
data/Gemfile.lock CHANGED
@@ -1,3 +1,9 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ devinator (0.0.3)
5
+ tty-command
6
+
1
7
  GEM
2
8
  specs:
3
9
 
@@ -6,7 +12,7 @@ GEM
6
12
  specs:
7
13
  ast (2.4.3)
8
14
  diff-lcs (1.6.2)
9
- json (2.15.1)
15
+ json (2.15.2)
10
16
  language_server-protocol (3.17.0.5)
11
17
  lint_roller (1.1.0)
12
18
  parallel (1.27.0)
@@ -77,9 +83,9 @@ PLATFORMS
77
83
  x86_64-linux
78
84
 
79
85
  DEPENDENCIES
86
+ devinator!
80
87
  rspec!
81
88
  standardrb!
82
- tty-command!
83
89
 
84
90
  BUNDLED WITH
85
91
  2.7.2
data/Makefile CHANGED
@@ -1,7 +1,13 @@
1
- .PHONY: setup_hooks pretty build
1
+ .PHONY: setup_hooks pretty build clean deploy
2
+ clean:
3
+ rm *.gem
4
+
2
5
  build:
3
6
  gem build
4
7
 
8
+ deploy: clean build
9
+ gem push devinator-*.gem
10
+
5
11
  setup_hooks:
6
12
  git config core.hooksPath ./.git-hooks
7
13
 
data/README.md CHANGED
@@ -8,9 +8,60 @@ opinionated but can be twisted to your will.
8
8
  Simply `cd` to your project and run `devinator`. It will do several things for
9
9
  you in this order:
10
10
 
11
+ 1. `bin/setup`
12
+ 2. launch your editor
13
+ 3. start `tmux`
14
+ 4. run the commands in `Procfile.dev` or `bin/dev`
15
+
16
+ ### With a dx setup
17
+
18
+ If you have some extra files they will be used to run your project in the dx
19
+ environment. So running it would look more like:
20
+
11
21
  1. `dx/build`
12
22
  2. `dx/start`
13
- 3. `bin/setup` or `bin/setup`
14
- 4. start your multiplexer
23
+ 3. `dx/exec bin/setup`
15
24
  5. launch your editor
16
- 6. run the commands in `Procfile.dev` or `bin/dev`
25
+ 4. start `tmux`
26
+ 6. run the commands in `Procfile.dev` prefixed with `dx/exec` or `dx/exec bin/dev`
27
+
28
+ ## Installation for Linux/OSX
29
+
30
+ 1. run `ruby --version` to confirm it's installed
31
+ 1. run `tmux -V` to confirm it's installed
32
+ 2. `gem install devinator`
33
+ 3. `which devinator` to confirm it installed and is in your `$PATH`
34
+
35
+ ## Configuration
36
+
37
+ Open `~/.config/devinator.rb` with your editor of choice and add the following
38
+ content:
39
+
40
+ ```ruby
41
+ Devinator::Config.configure do |config|
42
+ # Use this to run any personal commands before the usual culprits, this is
43
+ # useful for loading secrets and the like.
44
+ config.setup_commands = []
45
+
46
+ # If your editor is run in as :first_command or :last_command then this is the
47
+ # title that tmux will get for that window.
48
+ config.editor.title = "editor"
49
+
50
+ # This is your editor command, if you're running it with a timing of
51
+ # :end_of_setup then you will want to make sure this isn't foregrounded. I
52
+ # belive `code` by default will go into the background, so that's a good setup
53
+ # if you use VSCode.
54
+ config.editor.command = ENV["EDITOR"]
55
+
56
+ # This is when you want your editor command to run, the valid options are:
57
+ # - :end_of_setup
58
+ # - :first_command
59
+ # - :last_command
60
+ #
61
+ # :end_of_setup will call it as the last setup command before tmux is
62
+ # launched.
63
+ # :first_command will call it in the first window of tmux
64
+ # :last_command will call it in the last window of tmux
65
+ config.editor.timing = :first_command
66
+ end
67
+ ```
data/bin/dev ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ bin/test
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ echo "=== Ruby ==="
4
+ ruby --version
5
+
6
+ echo "=== Bundle ==="
7
+ bundle check || bundle install
data/devinator.gemspec CHANGED
@@ -18,4 +18,6 @@ Gem::Specification.new do |gem|
18
18
  gem.executables = [
19
19
  "devinator"
20
20
  ]
21
+
22
+ gem.add_dependency "tty-command"
21
23
  end
@@ -19,10 +19,10 @@ class Devinator
19
19
 
20
20
  @setup_commands += user_configuration.setup_commands
21
21
 
22
- @setup_commands << "dx/build" if File.exist? "dx/build"
23
- @setup_commands << "dx/start" if File.exist? "dx/start"
22
+ @setup_commands << "dx/build" if File.file? "dx/build"
23
+ @setup_commands << "dx/start" if File.file? "dx/start"
24
24
 
25
- @setup_commands << dx_exec("bin/setup") if File.exist? "bin/setup"
25
+ @setup_commands << dx_exec("bin/setup") if File.file? "bin/setup"
26
26
 
27
27
  @setup_commands << user_configuration.editor.command if user_configuration.editor.timing == :end_of_setup
28
28
 
@@ -39,13 +39,13 @@ class Devinator
39
39
  }
40
40
  end
41
41
 
42
- if File.exist? "Procfile.dev"
42
+ if File.file? "Procfile.dev"
43
43
  File.read("Procfile.dev").lines.each { |line|
44
44
  name, command = line.split(":", 2)
45
45
  @commands << {title: name, command: dx_exec(command.strip)}
46
46
  }
47
47
 
48
- elsif File.exist? "bin/dev"
48
+ elsif File.file? "bin/dev"
49
49
  @commands << {title: "dev", command: dx_exec("bin/dev")}
50
50
  end
51
51
 
@@ -61,7 +61,7 @@ class Devinator
61
61
 
62
62
  private_class_method def self.dx_exec(command)
63
63
  result = ""
64
- result << "dx/exec " if File.exist? "dx/exec"
64
+ result << "dx/exec " if File.file? "dx/exec"
65
65
  result << command
66
66
  end
67
67
  end
@@ -1,3 +1,3 @@
1
1
  class Devinator
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/devinator.rb CHANGED
@@ -8,7 +8,7 @@ class Devinator
8
8
  tty = TTY::Command.new(uuid: false)
9
9
 
10
10
  user_config_path = File.expand_path("~/.config/devinator.rb")
11
- Kernel.require(user_config_path) if File.exist?(user_config_path)
11
+ Kernel.require(user_config_path) if File.file?(user_config_path)
12
12
 
13
13
  Devinator::Config.setup_commands.each { tty.run it, only_output_on_error: true }
14
14
 
@@ -15,7 +15,7 @@ describe Devinator do
15
15
 
16
16
  it "runs the setup commands before run commands" do
17
17
  expect(File).to receive(:expand_path).with("~/.config/devinator.rb").and_return("user config")
18
- expect(File).to receive(:exist?).with("user config").and_return(false)
18
+ expect(File).to receive(:file?).with("user config").and_return(false)
19
19
  expect(TTY::Command).to receive(:new).with(uuid: false)
20
20
 
21
21
  expect(Dir).to receive(:pwd).and_return("/path/to/project")
@@ -44,7 +44,7 @@ describe Devinator do
44
44
 
45
45
  it "loads the user config" do
46
46
  expect(File).to receive(:expand_path).with("~/.config/devinator.rb").and_return("user config")
47
- expect(File).to receive(:exist?).with("user config").and_return(true)
47
+ expect(File).to receive(:file?).with("user config").and_return(true)
48
48
 
49
49
  expect(Kernel).to receive(:require).with("user config")
50
50
 
metadata CHANGED
@@ -1,14 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devinator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Earle
8
8
  bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
- dependencies: []
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: tty-command
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
12
26
  description: |2
13
27
  A little tool to help you get your development
14
28
  environment up and running with a single command.
@@ -26,8 +40,10 @@ files:
26
40
  - Gemfile.lock
27
41
  - Makefile
28
42
  - README.md
43
+ - bin/dev
29
44
  - bin/devinator
30
45
  - bin/pretty
46
+ - bin/setup
31
47
  - bin/test
32
48
  - devinator.gemspec
33
49
  - lib/devinator.rb
@@ -60,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
76
  - !ruby/object:Gem::Version
61
77
  version: '0'
62
78
  requirements: []
63
- rubygems_version: 3.6.7
79
+ rubygems_version: 3.7.2
64
80
  specification_version: 4
65
81
  summary: Start your development environment with one command!
66
82
  test_files: []