lolcommits-tumblr 0.3.0 → 0.4.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: 283892fd577aaa15ffc614e5698f79f676e42007303527dd751a050c842aba0b
4
- data.tar.gz: b11f34c43109a44bf8aec1d2ba6bd721811c9edb75de03df7a0a71e00dc6a361
3
+ metadata.gz: c4fa6fed2b3430dc31eabd030cfc3964fd1a0b1e5f66861fec8c735bf10bfa83
4
+ data.tar.gz: 75971beeb5c7ea578842b7e57b827fe97e093dab32fa3a4d67046c7ba527fbf4
5
5
  SHA512:
6
- metadata.gz: dfd80584bbc67b84dbadbc1b9009fb9d21efeef790f2b0720cc8c62ada92d22c834cd67a13211aab63220b7abfed6dd9807107f805ae4c7a637df6066be3f1b4
7
- data.tar.gz: d0476cd8fc396e2300c5846a7df49be8710047ff5f6f716ca210ac7dc6e8091f38bc2c2612321f067ae27cbcb68c01f776de0fcd4a98d3b22829f3253be69a50
6
+ metadata.gz: 5471f92d865465e1096b63b5ea22ee49b6acf1f5e83512d628f9f2e5eca5d84537d12775b213fd1ce220bccafd63019c6ecd8481a20851de5c4eed87b655760d
7
+ data.tar.gz: 0e855b23e4d60726bd0f0aede0a0d802e8eba2461cb6c42594816e9e7d29dba22cf8cc6affa857a804921cd48f4cdb7408b8216466582bf97ab8a7948b5b4aaf
@@ -2,13 +2,23 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- The format is based on [Keep a Changelog][KeepAChangelog] and this project
6
- adheres to [Semantic Versioning][Semver].
5
+ The format is based on [Keep a Changelog][KeepAChangelog] and this
6
+ project adheres to [Semantic Versioning][Semver].
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
10
  - Your contribution here!
11
11
 
12
+ ## [0.4.0] - 2019-05-20
13
+ ### Changed
14
+ - lolcommits gem is a runtime dependency
15
+ - Use `lolcommit_path` (instead of `main_image`)
16
+ - Requires at least lolcommits >= `0.14.2`
17
+ - Updated README and gemspec
18
+
19
+ ### Removed
20
+ - Support for lolcommits < `0.14.2`
21
+
12
22
  ## [0.3.0] - 2019-04-24
13
23
  ### Removed
14
24
  - Support for Ruby < 2.3 (older rubies no longer supported)
@@ -53,7 +63,8 @@ adheres to [Semantic Versioning][Semver].
53
63
  ### Changed
54
64
  - Initial release
55
65
 
56
- [Unreleased]: https://github.com/lolcommits/lolcommits-tumblr/compare/v0.3.0...HEAD
66
+ [Unreleased]: https://github.com/lolcommits/lolcommits-tumblr/compare/v0.4.0...HEAD
67
+ [0.4.0]: https://github.com/lolcommits/lolcommits-tumblr/compare/v0.3.0...v0.4.0
57
68
  [0.3.0]: https://github.com/lolcommits/lolcommits-tumblr/compare/v0.2.0...v0.3.0
58
69
  [0.2.0]: https://github.com/lolcommits/lolcommits-tumblr/compare/v0.1.1...v0.2.0
59
70
  [0.1.1]: https://github.com/lolcommits/lolcommits-tumblr/compare/v0.1.0...v0.1.1
data/README.md CHANGED
@@ -1,17 +1,18 @@
1
1
  # Lolcommits Tumblr
2
2
 
3
3
  [![Gem](https://img.shields.io/gem/v/lolcommits-tumblr.svg?style=flat)](http://rubygems.org/gems/lolcommits-tumblr)
4
- [![Travis](https://travis-ci.org/lolcommits/lolcommits-tumblr.svg?branch=master)](https://travis-ci.org/lolcommits/lolcommits-tumblr)
4
+ [![Travis](https://img.shields.io/travis/com/lolcommits/lolcommits-tumblr/master.svg?style=flat)](https://travis-ci.com/lolcommits/lolcommits-tumblr)
5
5
  [![Depfu](https://img.shields.io/depfu/lolcommits/lolcommits-tumblr.svg?style=flat)](https://depfu.com/github/lolcommits/lolcommits-tumblr)
6
6
  [![Maintainability](https://api.codeclimate.com/v1/badges/0c289196d8504223c31a/maintainability)](https://codeclimate.com/github/lolcommits/lolcommits-tumblr/maintainability)
7
7
  [![Test Coverage](https://api.codeclimate.com/v1/badges/0c289196d8504223c31a/test_coverage)](https://codeclimate.com/github/lolcommits/lolcommits-tumblr/test_coverage)
8
8
 
9
- [lolcommits](https://lolcommits.github.io/) takes a snapshot with your webcam
10
- every time you git commit code, and archives a lolcat style image with it. Git
11
- blame has never been so much fun!
9
+ [lolcommits](https://lolcommits.github.io/) takes a snapshot with your
10
+ webcam every time you git commit code, and archives a lolcat style image
11
+ with it. Git blame has never been so much fun!
12
12
 
13
- This is a simple plugin to post lolcommits to your Tumblr. Configure it with a
14
- Tumblr access token and secret (the plugin will guide you through this process).
13
+ This is a simple plugin to post lolcommits to your Tumblr. Configure it
14
+ with a Tumblr access token and secret (the plugin will guide you through
15
+ this process).
15
16
 
16
17
  ## Requirements
17
18
 
@@ -27,8 +28,8 @@ After installing the lolcommits gem, install this plugin with:
27
28
 
28
29
  $ gem install lolcommits-tumblr
29
30
 
30
- Then configure to enable. If this is your first time setting up, you'll be asked
31
- to visit Tumblr to authenticate and allow access.
31
+ Then configure to enable. If this is your first time setting up, you'll
32
+ be asked to visit Tumblr to authenticate and allow access.
32
33
 
33
34
  $ lolcommits --config -p tumblr
34
35
  # set enabled to `true`
@@ -36,26 +37,27 @@ to visit Tumblr to authenticate and allow access.
36
37
  # click 'allow' then return to the console to set your Tumblr name
37
38
  # optionally set the plugin to auto-open each created Tumblr post
38
39
 
39
- That's it! Your next lolcommit will automatically be posted to your Tumblr blog.
40
- To disable use:
40
+ That's it! Your next lolcommit will automatically be posted to your
41
+ Tumblr blog. To disable use:
41
42
 
42
43
  $ lolcommits --config -p tumblr
43
44
  # and set enabled to `false`
44
45
 
45
46
  ## Development
46
47
 
47
- Check out this repo and run `bin/setup`, this will install all dependencies and
48
- generate docs. Use `bundle exec rake` to run all tests and generate a coverage
49
- report.
48
+ Check out this repo and run `bin/setup`, this will install all
49
+ dependencies and generate docs. Use `bundle exec rake` to run all tests
50
+ and generate a coverage report.
50
51
 
51
- You can also run `bin/console` for an interactive prompt that will allow you to
52
- experiment with the gem code.
52
+ You can also run `bin/console` for an interactive prompt that will allow
53
+ you to experiment with the gem code.
53
54
 
54
- This plugin uses the [tumblr-client](https://github.com/tumblr/tumblr_client)
55
- and [OAuth](https://rubygems.org/gems/oauth/versions/0.5.3) gems. A
55
+ This plugin uses the
56
+ [tumblr-client](https://github.com/tumblr/tumblr_client) and
57
+ [OAuth](https://rubygems.org/gems/oauth/versions/0.5.3) gems. A
56
58
  [Webrick](https://rubygems.org/gems/webrick) server is started during
57
- configuration, to provide a responding `return_uri` for the OAuth flow to
58
- complete.
59
+ configuration, to provide a responding `return_uri` for the OAuth flow
60
+ to complete.
59
61
 
60
62
  ## Tests
61
63
 
@@ -72,25 +74,27 @@ Generate docs for this gem with:
72
74
  ## Troubles?
73
75
 
74
76
  If you think something is broken or missing, please raise a new
75
- [issue](https://github.com/lolcommits/lolcommits-tumblr/issues). Take
76
- a moment to check it hasn't been raised in the past (and possibly closed).
77
+ [issue](https://github.com/lolcommits/lolcommits-tumblr/issues). Take a
78
+ moment to check it hasn't been raised in the past (and possibly closed).
77
79
 
78
80
  ## Contributing
79
81
 
80
- Bug [reports](https://github.com/lolcommits/lolcommits-tumblr/issues) and [pull
81
- requests](https://github.com/lolcommits/lolcommits-tumblr/pulls) are welcome on
82
- GitHub.
82
+ Bug [reports](https://github.com/lolcommits/lolcommits-tumblr/issues)
83
+ and [pull
84
+ requests](https://github.com/lolcommits/lolcommits-tumblr/pulls) are
85
+ welcome on GitHub.
83
86
 
84
- When submitting pull requests, remember to add tests covering any new behaviour,
85
- and ensure all tests are passing on [Travis
86
- CI](https://travis-ci.org/lolcommits/lolcommits-tumblr). Read the
87
+ When submitting pull requests, remember to add tests covering any new
88
+ behaviour, and ensure all tests are passing on [Travis
89
+ CI](https://travis-ci.com/lolcommits/lolcommits-tumblr). Read the
87
90
  [contributing
88
91
  guidelines](https://github.com/lolcommits/lolcommits-tumblr/blob/master/CONTRIBUTING.md)
89
92
  for more details.
90
93
 
91
- This project is intended to be a safe, welcoming space for collaboration, and
92
- contributors are expected to adhere to the [Contributor
93
- Covenant](http://contributor-covenant.org) code of conduct. See
94
+ This project is intended to be a safe, welcoming space for
95
+ collaboration, and contributors are expected to adhere to the
96
+ [Contributor Covenant](http://contributor-covenant.org) code of conduct.
97
+ See
94
98
  [here](https://github.com/lolcommits/lolcommits-tumblr/blob/master/CODE_OF_CONDUCT.md)
95
99
  for more details.
96
100
 
@@ -101,7 +105,7 @@ The gem is available as open source under the terms of
101
105
 
102
106
  ## Links
103
107
 
104
- * [Travis CI](https://travis-ci.org/lolcommits/lolcommits-tumblr)
108
+ * [Travis CI](https://travis-ci.com/lolcommits/lolcommits-tumblr)
105
109
  * [Code Climate](https://codeclimate.com/github/lolcommits/lolcommits-tumblr)
106
110
  * [Test Coverage](https://codeclimate.com/github/lolcommits/lolcommits-tumblr/coverage)
107
111
  * [RDoc](http://rdoc.info/projects/lolcommits/lolcommits-tumblr)
@@ -16,24 +16,22 @@ module Lolcommits
16
16
  TUMBLR_CONSUMER_SECRET = 'qWuvxgFUR2YyWKtbWOkDTMAiBEbj7ZGaNLaNQPba0PI1N4JpBs'.freeze
17
17
 
18
18
  ##
19
- # Post-capture hook, runs after lolcommits captures a snapshot. Uploads
20
- # the lolcommit image to the remote server with an optional Authorization
21
- # header and the following request params.
19
+ # Post-capture hook, runs after lolcommits captures a snapshot.
22
20
  #
23
- # `file` - captured lolcommit image file
24
- # `message` - the commit message
25
- # `repo` - repository name e.g. mroth/lolcommits
26
- # `sha` - commit SHA
27
- # `key` - key (string) from plugin configuration (optional)
28
- # `author_name` - the commit author name
29
- # `author_email` - the commit author email address
30
- #
31
- # @return [RestClient::Response] response object from POST request
32
- # @return [Nil] if any error occurs
21
+ # Posts the lolcommit main image to Tumblr, printing success or
22
+ # failure message to stdout.
33
23
  #
34
24
  def run_capture_ready
25
+ if runner.capture_video && !runner.capture_gif
26
+ debug "unable to post lolcommit videos, (gif's and jpgs only)"
27
+ return
28
+ end
29
+
35
30
  print "*** Posting to Tumblr ... "
36
- post = client.photo(configuration[:tumblr_name], data: runner.main_image)
31
+ post = client.photo(
32
+ configuration[:tumblr_name],
33
+ data: image_path
34
+ )
37
35
 
38
36
  if post.key?('id')
39
37
  post_url = tumblr_post_url(post)
@@ -80,6 +78,10 @@ module Lolcommits
80
78
 
81
79
  private
82
80
 
81
+ def image_path
82
+ runner.capture_image? ? runner.lolcommit_path : runner.lolcommit_gif_path
83
+ end
84
+
83
85
  def configure_auth!
84
86
  puts ''
85
87
  puts '----------------------------------------'
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lolcommits
4
4
  module Tumblr
5
- VERSION = "0.3.0".freeze
5
+ VERSION = "0.4.0".freeze
6
6
  end
7
7
  end
@@ -9,29 +9,21 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ["matt@hiddenloop.com"]
10
10
  spec.summary = %q{Post lolcommits to Tumblr}
11
11
  spec.homepage = "https://github.com/lolcommits/lolcommits-tumblr"
12
- spec.license = "LGPL-3"
12
+ spec.license = "LGPL-3.0"
13
13
 
14
14
  spec.description = <<-DESC
15
- A simple plugin to post lolcommits to your Tumblr. Configure it with a Tumblr
16
- access token and secret.
15
+ A simple plugin to post lolcommits to your Tumblr. Configure it with a
16
+ Tumblr access token and secret.
17
17
  DESC
18
18
 
19
19
  spec.metadata = {
20
- "homepage_uri" => "https://github.com/lolcommits/lolcommits-tumblr",
21
- "changelog_uri" => "https://github.com/lolcommits/lolcommits-tumblr/blob/master/CHANGELOG.md",
22
- "source_code_uri" => "https://github.com/lolcommits/lolcommits-tumblr",
23
- "bug_tracker_uri" => "https://github.com/lolcommits/lolcommits-tumblr/issues",
20
+ "homepage_uri" => "https://github.com/lolcommits/lolcommits-tumblr",
21
+ "changelog_uri" => "https://github.com/lolcommits/lolcommits-tumblr/blob/master/CHANGELOG.md",
22
+ "source_code_uri" => "https://github.com/lolcommits/lolcommits-tumblr",
23
+ "bug_tracker_uri" => "https://github.com/lolcommits/lolcommits-tumblr/issues",
24
+ "allowed_push_host" => "https://rubygems.org"
24
25
  }
25
26
 
26
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
27
- # to allow pushing to a single host or delete this section to allow pushing to any host.
28
- if spec.respond_to?(:metadata)
29
- spec.metadata['allowed_push_host'] = "https://rubygems.org"
30
- else
31
- raise "RubyGems 2.0 or newer is required to protect against " \
32
- "public gem pushes."
33
- end
34
-
35
27
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(assets|test|features)/}) }
36
28
  spec.test_files = `git ls-files -- {test,features}/*`.split("\n")
37
29
  spec.bindir = "bin"
@@ -43,8 +35,8 @@ Gem::Specification.new do |spec|
43
35
  spec.add_runtime_dependency('tumblr_client')
44
36
  spec.add_runtime_dependency('webrick')
45
37
  spec.add_runtime_dependency('oauth')
38
+ spec.add_runtime_dependency "lolcommits", ">= 0.14.2"
46
39
 
47
- spec.add_development_dependency "lolcommits", ">= 0.12.0"
48
40
  spec.add_development_dependency "bundler"
49
41
  spec.add_development_dependency "webmock"
50
42
  spec.add_development_dependency "pry"
@@ -14,7 +14,7 @@ describe Lolcommits::Plugin::Tumblr do
14
14
  def runner
15
15
  # a simple lolcommits runner with an empty configuration Hash
16
16
  @runner ||= Lolcommits::Runner.new(
17
- main_image: Tempfile.new("main_image.jpg").path
17
+ lolcommit_path: Tempfile.new("lolcommit.jpg").path
18
18
  )
19
19
  end
20
20
 
@@ -47,7 +47,7 @@ describe Lolcommits::Plugin::Tumblr do
47
47
  before { commit_repo_with_message("first commit!") }
48
48
  after { teardown_repo }
49
49
 
50
- it "posts lolcommit image to tumblr showing link to new photo post" do
50
+ it "posts lolcommit to tumblr showing link to new photo post" do
51
51
  in_repo do
52
52
  plugin.configuration = valid_enabled_config
53
53
 
@@ -65,7 +65,7 @@ describe Lolcommits::Plugin::Tumblr do
65
65
 
66
66
  assert_requested :post, "https://api.tumblr.com/v2/blog/my-tumblr.tumblr.com/post", times: 1,
67
67
  headers: { "Content-Type" => /multipart\/form-data/, "Accept" => "application/json" } do |req|
68
- req.body.must_match 'filename="main_image.jpg'
68
+ req.body.must_match 'filename="lolcommit.jpg'
69
69
  end
70
70
  end
71
71
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lolcommits-tumblr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Hutchinson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-24 00:00:00.000000000 Z
11
+ date: 2019-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tumblr_client
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 0.12.0
62
- type: :development
61
+ version: 0.14.2
62
+ type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 0.12.0
68
+ version: 0.14.2
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -151,8 +151,8 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  description: |2
154
- A simple plugin to post lolcommits to your Tumblr. Configure it with a Tumblr
155
- access token and secret.
154
+ A simple plugin to post lolcommits to your Tumblr. Configure it with a
155
+ Tumblr access token and secret.
156
156
  email:
157
157
  - matt@hiddenloop.com
158
158
  executables: []
@@ -180,7 +180,7 @@ files:
180
180
  - test/test_helper.rb
181
181
  homepage: https://github.com/lolcommits/lolcommits-tumblr
182
182
  licenses:
183
- - LGPL-3
183
+ - LGPL-3.0
184
184
  metadata:
185
185
  homepage_uri: https://github.com/lolcommits/lolcommits-tumblr
186
186
  changelog_uri: https://github.com/lolcommits/lolcommits-tumblr/blob/master/CHANGELOG.md