nutrella 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1293e7c5219675d114aeaf297747afe4e59d377453d7820f540a902840b61708
4
- data.tar.gz: cad1baf4863b3d17d4bc59b2fd74b0086375d16442e1e14de0901b00a3ba3863
3
+ metadata.gz: '028df6d8d790fb53fcc4a46363d9fd232ce9885c0c812789e0fe3d7ed7103411'
4
+ data.tar.gz: c0d2d3d86b0c41e144bbeaeeb5ff98027de50319d77fe2a1c661d372ff3f4359
5
5
  SHA512:
6
- metadata.gz: 8418ea70d0607dd2dc6e459b06807f8170afef1e157e6c40dd7cca6304f2acd374dfb710d6aa8d97c55856ae9784c7ef9454a38a787267074601f023865a125e
7
- data.tar.gz: 96de4930fb211a2d84067350c342c70ad05c6398d73ee34821880bb9977f40828cfa31804ea9d36dd55e22186aead9baa6f58dabfb46149bb1c75445d0ee99ff
6
+ metadata.gz: 05e5d5bd4ccfeb259f3d087baf21d20d2c85c77fd88cab817b8027c5117204a1e8a21e3ae9183ce8efe2dc4e26c9d66c404f788aa82ee377163a3e6d25d1b4ba
7
+ data.tar.gz: b3beec9904c278490a689107bf7ababa95f3ef7ccf01d564b36634eccba01904c9290dcb695594732c45892994dcde462c722681fb195e471f875fb05f81fc04
data/README.md CHANGED
@@ -64,7 +64,7 @@ Create or open a Trello board based on the name of the current git branch:
64
64
 
65
65
  Create or open a named Trello board:
66
66
 
67
- $ nutrella <board-name>
67
+ $ nutrella <git-branch-name>
68
68
 
69
69
  Note: you can invoke the `nutrella` from your project directory or from any subdirectory.
70
70
 
@@ -2,7 +2,6 @@
2
2
 
3
3
  require "nutrella"
4
4
 
5
- board_name = Nutrella::TaskBoardName.from_command_line(ARGV) ||
6
- Nutrella::TaskBoardName.from_git_branch
5
+ board_name = Nutrella::TaskBoardName.board_name(ARGV)
7
6
 
8
7
  Nutrella::Command.new(Dir.home, board_name).run
@@ -4,27 +4,17 @@ module Nutrella
4
4
  #
5
5
  # Knows the name of the task board associated with the current git branch.
6
6
  #
7
- module TaskBoardName
8
- def self.from_git_branch
7
+ # Note: will also accept the name of a branch as an argument.
8
+ #
9
+ class TaskBoardName
10
+ def self.board_name(args)
9
11
  git_branch_name, status = Open3.capture2("git rev-parse --abbrev-ref HEAD")
12
+ return git_branch_name.chomp if status.success?
10
13
 
11
- abort "Sorry. Can't find an associated git branch here." unless status.success?
12
-
13
- normalize(git_branch_name)
14
- end
15
-
16
- def self.from_command_line(args)
17
14
  git_branch_name = args[0]
15
+ return git_branch_name if git_branch_name.present?
18
16
 
19
- abort "Sorry. Can't create a board without a branch name." unless git_branch_name.present?
20
-
21
- normalize(git_branch_name)
22
- end
23
-
24
- private
25
-
26
- def self.normalize(git_branch_name)
27
- git_branch_name.chomp.titleize
17
+ abort "Sorry. Can't figure out a name for the board."
28
18
  end
29
19
  end
30
20
  end
@@ -1,3 +1,3 @@
1
1
  module Nutrella
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nutrella
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alistair McKinnell