git_notified_on_trello 0.0.1 → 0.0.2

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: 5d40138fe5bfebe845e82969b6c1c0421079a011
4
- data.tar.gz: bcc8b5e596474bcf89930790e4d748ad8c7ec2e8
3
+ metadata.gz: f179eca101f5089f27be964a69d56f54519be24f
4
+ data.tar.gz: 48854e79435d079fe6fc689334e8b9b1c6384ead
5
5
  SHA512:
6
- metadata.gz: 3905bd923f14cb935db699887be954133d527b31bb314ae56316d033d99617317625bc4f3349c0c4f4a82aa89f02690f482f7405bfebf61017419e6a21a5b7a5
7
- data.tar.gz: 1fa46db39ff0c08deb1c75d63b9816c4ddb7b93f2981c27ee371bd003381e9f2955b6d764d8c3331655493c2f5d3577efe446a41779a51408926933d97e5e35c
6
+ metadata.gz: fbfedf4988898b7fdc1f85a9e68f95fa54e85de0b9bebb163ba114ae9afcaab897014fde11f9075d0a108d1755a7e0e4bcd1d6d22108fec3c7c3d3042ff69439
7
+ data.tar.gz: 4d12fd2ac71d5c9a832dac137e9bd92e1a51d35ae8edea6a71395ae6b633997e7116ccd8997113e12f5dbf29d9819fc6bf2c9317d5c1617825308719a690019e
data/.travis.yml CHANGED
@@ -11,11 +11,11 @@ cache:
11
11
 
12
12
  install: bundle install --jobs=3 --retry=3
13
13
 
14
- deploy:
15
- provider: rubygems
16
- api_key: "38d57d2ad2520318f2155c1cc717925f"
17
- gem:
18
- master: git_notified_on_trello
19
- on:
20
- tags: true
21
- branch: master
14
+ #deploy:
15
+ # provider: rubygems
16
+ # api_key: "38d57d2ad2520318f2155c1cc717925f"
17
+ # gem:
18
+ # master: git_notified_on_trello
19
+ # on:
20
+ # tags: true
21
+ # branch: master
data/README.md CHANGED
@@ -4,36 +4,89 @@ git_notified_on_trello
4
4
  Get notified of pushes to a Git Repo with updates to relevant Trello cards
5
5
 
6
6
 
7
- Setup
8
- -----
7
+ ### Setup ###
9
8
 
10
- https://trello.com/1/authorize?key=YOUR_API_KEY&name=YOUR_APP_NAME&response_type=token&scope=read,write,account&expiration=never
11
- -
9
+ To enable posting to Trello, you must get authorization to post on behalf of a user.
12
10
 
11
+ Trello makes this very easy.
13
12
 
14
- ### TODO ###
13
+ You can read more on the [Trello API Documentation](https://trello.com/docs/) pages, but here's the quick-start:
14
+
15
+
16
+ 1. Generate (or view it if you've already created one) your developer key [https://trello.com/1/appKey/generate](https://trello.com/1/appKey/generate)
17
+
18
+ 2. Generate a consumer key / member token
19
+ - Replace YOUR_API_KEY with the key received above
20
+ - Replace YOUR_APP_NAME with the friendly name you'd like to display to users
21
+ - Modify *scope* and *expiration* for your needs
22
+
23
+ Template: https://trello.com/1/authorize?key=YOUR_API_KEY&name=YOUR_APP_NAME&response_type=token&scope=read,write,account&expiration=never
24
+
25
+ More information can be found on Trello [Getting a Token From a User](https://trello.com/docs/gettingstarted/index.html#getting-a-token-from-a-user)
26
+
27
+
28
+ Here's a wizard that'll walk you through generating the URL:
29
+
30
+ ```bash
31
+ curl -sSfL https://raw.githubusercontent.com/smj10j/git_notified_on_trello/master/docs/trello-get-oauth-url-wizard.sh | /bin/bash
32
+ ```
33
+
34
+
35
+
36
+
37
+ ### Installation ###
38
+
39
+ ```bash
40
+ gem install git_notified_on_trello
41
+ ```
15
42
 
16
- - provide example usage
17
- - clean up and comment a bit
18
- - package into a gem
19
- - make idempotent
20
- - make a plugin for jenkins
21
- - send two separate messages
22
- - on commit, as it does now
23
- - on deploy
24
- - style the comments with some fancy markdown
25
43
 
26
44
 
27
- rake install \
28
- DEVELOPER_KEY="16f7525a7039ee80c23365e648b8a542" \
29
- MEMBER_TOKEN="" \
30
- ./bin/gnot -a "Stephen Johnson" -b "feature-git-notified-on-trello" -c "3463457" -m " Is it useful?\n\nhttps://trello.com/c/hR3cSUiu/1189-git-trello-plugin \nLine break on the shell like a normal commit messages would be.\n\nLet's try some *markdown*\n-------------------------\n"
45
+ ### Usage ###
31
46
 
32
47
 
48
+ #### As a gem within your project ####
33
49
 
50
+ ```ruby
51
+ require 'git_notified_on_trello'
52
+
53
+ notifier = GitNotifiedOnTrello::Notifier.new(
54
+ :developer_public_key => <YOUR TRELLO DEV KEY>,
55
+ :member_token => <A TRELLO MEMBER TOKEN>,
56
+ :debug => true
57
+ )
58
+ notifier.notify(
59
+ "feature-git-notified-on-trello", // Branch
60
+ "b7cb566c2310697f401c51433dce6b6399429fdb", // Commit hash
61
+ "Stephen Johnson", // Commit author
62
+ "Updated the readme per https://trello.com/c/hR3cSUiu/1189-git-trello-plugin" // Commit message
63
+ )
64
+ ```
65
+
66
+
67
+
68
+ #### On the command-line ####
69
+
70
+ ```bash
71
+ DEVELOPER_KEY="<YOUR TRELLO DEV KEY>" \
72
+ MEMBER_TOKEN="<A TRELLO MEMBER TOKEN>" \
73
+ gnot \
74
+ -b "feature-git-notified-on-trello" \
75
+ -c "b7cb566c2310697f401c51433dce6b6399429fdb" \
76
+ -a "Stephen Johnson" \
77
+ -m "Updated the readme per https://trello.com/c/hR3cSUiu/1189-git-trello-plugin"
78
+ ```
79
+
80
+
81
+
82
+
83
+ ### TODO ###
34
84
 
35
- # Get consumer key by calling
36
- # https://trello.com/1/authorize?key=16f7525a7039ee80c23365e648b8a542&name=Git%20Notified%20on%20Trello&response_type=token&scope=read,write,account&expiration=never
85
+ - Clean up and comment a bit
86
+ - Make idempotent and add function to watch a git repo for commits
87
+ - Make a plugin for Jenkins
88
+ - Send two separate messages
89
+ - On commit, as it does now
90
+ - On deploy
91
+ - Add tests...
37
92
 
38
- # If you'd like to use your own application, replace the above with this:
39
- # https://trello.com/1/authorize?key=YOUR_API_KEY&name=YOUR_APP_NAME&response_type=token&scope=read,write,account&expiration=never
data/deploy.sh ADDED
@@ -0,0 +1,43 @@
1
+ #!/bin/bash
2
+
3
+ VERSION_FILE="lib/git_notified_on_trello/version.rb"
4
+
5
+ # Extract the version into something we can work with
6
+ V=$(cat "$VERSION_FILE" | awk '/VERSION/ {print $3}' | tr -d '"')
7
+ VERSION=${V:0:1}
8
+ MAJOR=${V:2:1}
9
+ MINOR=${V:4:1}
10
+
11
+ # Do the version bump
12
+ if [[ $MINOR -lt 9 ]]; then
13
+ MINOR=$(( $MINOR + 1 ))
14
+ elif [[ $MAJOR -lt 9 ]]; then
15
+ MINOR=0
16
+ MAJOR=$(( $MAJOR + 1 ))
17
+ else
18
+ MINOR=0
19
+ MAJOR=0
20
+ VERSION=$(( $VERSION + 1 ))
21
+ fi
22
+
23
+ # Get the version back into a string
24
+ TAG="$VERSION.$MAJOR.$MINOR"
25
+ echo "Releasing gem with tag $TAG"
26
+
27
+ # Update the version file
28
+ sed -i 's/\(.*\)VERSION = .*/\1VERSION = "'$TAG'"/' "$VERSION_FILE"
29
+
30
+ # Commit the changes for the bump
31
+ git add $VERSION_FILE
32
+ git commit -m "Release $TAG"
33
+ git push
34
+
35
+ # Tag the release
36
+ git tag "$TAG"
37
+ git push --tags
38
+
39
+ # Make it so
40
+ rake release
41
+
42
+
43
+ echo "Done!"
@@ -0,0 +1,34 @@
1
+ #!/bin/bash
2
+
3
+ echo -n "Press any key to open Trello. Log in if prompted, copy your developer API key, and return to this window."
4
+ read -e < /dev/tty
5
+ open https://trello.com/1/appKey/generate
6
+
7
+ echo -n "Paste your developer key: "
8
+ read -e developer_key < /dev/tty
9
+
10
+ echo -n "Friendly app name: "
11
+ read -e app_name < /dev/tty
12
+
13
+ echo -n "Scope (default: read,write,account): "
14
+ read -e scope < /dev/tty
15
+
16
+ echo -n "Expiration (default: never): "
17
+ read -e expiration < /dev/tty
18
+
19
+ url="https://trello.com/1/authorize?\
20
+ key=${developer_key}&\
21
+ name=$(echo $app_name | perl -lpe 's/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg')&\
22
+ response_type=token&\
23
+ scope=${scope:=read,write,account}&\
24
+ expiration=${expiration:=never}"
25
+ echo ""
26
+ echo "URL to direct users to when asking for authorization: $url"
27
+ echo ""
28
+ echo -n "Press any key to open the URL in your browser."
29
+ read -e < /dev/tty
30
+ open "$url"
31
+
32
+ echo ""
33
+ echo "Goodbye!"
34
+ echo ""
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Stephen Johnson"]
10
10
  spec.email = ["steve@01j.me"]
11
11
  spec.summary = %q{Get notified of pushes to a Git Repo with updates to relevant Trello cards}
12
- spec.description = %q{Makes Trello more useful when managing software development teams}
12
+ spec.description = %q{Makes Trello more useful when managing software development teams by increasing two-way communication}
13
13
  spec.homepage = "https://github.com/smj10j/git_notified_on_trello"
14
14
  spec.license = "MIT"
15
15
 
@@ -18,9 +18,9 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_development_dependency "bundler", ">= 1.6.9"
22
- spec.add_development_dependency "rake", ">= 10.0"
23
- spec.add_development_dependency "rspec", ">= 3.1"
21
+ spec.add_development_dependency "bundler", ">= 1.6.9", "< 1.8.0"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "rspec", "~> 3.1"
24
24
 
25
25
  spec.add_runtime_dependency "ruby-trello", '~> 1.1.2'
26
26
  spec.add_runtime_dependency "trollop", '~> 2.0'
@@ -5,6 +5,7 @@
5
5
  #
6
6
 
7
7
  require 'trello'
8
+ require 'git_notified_on_trello/version'
8
9
 
9
10
  module GitNotifiedOnTrello
10
11
 
@@ -1,3 +1,3 @@
1
1
  module GitNotifiedOnTrello
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -1,8 +1,14 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe GitNotifiedOnTrello do
4
+
4
5
  it "expects the notifier instantiation to succeed" do
5
6
  n = GitNotifiedOnTrello::Notifier.new
6
7
  expect(n).to be_a GitNotifiedOnTrello::Notifier
7
8
  end
9
+
10
+ it "must be defined" do
11
+ expect(GitNotifiedOnTrello::VERSION).to_not be_nil
12
+ end
13
+
8
14
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_notified_on_trello
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Johnson
@@ -17,6 +17,9 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.6.9
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: 1.8.0
20
23
  type: :development
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -24,32 +27,35 @@ dependencies:
24
27
  - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: 1.6.9
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 1.8.0
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rake
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - ">="
37
+ - - "~>"
32
38
  - !ruby/object:Gem::Version
33
39
  version: '10.0'
34
40
  type: :development
35
41
  prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
- - - ">="
44
+ - - "~>"
39
45
  - !ruby/object:Gem::Version
40
46
  version: '10.0'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: rspec
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
- - - ">="
51
+ - - "~>"
46
52
  - !ruby/object:Gem::Version
47
53
  version: '3.1'
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
- - - ">="
58
+ - - "~>"
53
59
  - !ruby/object:Gem::Version
54
60
  version: '3.1'
55
61
  - !ruby/object:Gem::Dependency
@@ -80,7 +86,8 @@ dependencies:
80
86
  - - "~>"
81
87
  - !ruby/object:Gem::Version
82
88
  version: '2.0'
83
- description: Makes Trello more useful when managing software development teams
89
+ description: Makes Trello more useful when managing software development teams by
90
+ increasing two-way communication
84
91
  email:
85
92
  - steve@01j.me
86
93
  executables:
@@ -95,6 +102,8 @@ files:
95
102
  - README.md
96
103
  - Rakefile
97
104
  - bin/gnot
105
+ - deploy.sh
106
+ - docs/trello-get-oauth-url-wizard.sh
98
107
  - git_notified_on_trello.gemspec
99
108
  - lib/git_notified_on_trello.rb
100
109
  - lib/git_notified_on_trello/version.rb