lolcommits 0.8.1 → 0.9.0

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,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MmQ3ODk4ZDY4MWJmN2Y4MWIyMDA0MTM5ZWMyOTUyODNhN2UxNmQwNA==
5
- data.tar.gz: !binary |-
6
- NGM2ZDNkZmRlN2NkY2I1NTA4MTYyYWIwNzBjNzg4NjI0OTVkODVhNw==
2
+ SHA1:
3
+ metadata.gz: f26c2d1017250e7f0e83a24fb811c0592f67b778
4
+ data.tar.gz: 0d062c79096844310e474691e8b23d9e70470e6b
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MWVmNTA1OThmMDg4MTBjNWMyNjA2NDk0MDU1NDM0NDZjYzE4N2NiOWFiZjNm
10
- MTFlZGIxYzU1MWIzZjA2YmNmZTBhZGRlNDI1OGVkMzlhNTg3OGI4ZTRiMjJl
11
- MzJkNTU3MjlmZmRhNDkwMmNiODFkMDMxYmNlNTE2NGY5MWZjMjg=
12
- data.tar.gz: !binary |-
13
- NGE5M2IxYzZiZmVhMDE3MmE3YTJiY2VlODA1ZDE0NDhkZGNhMDlmZTA3NDAz
14
- Yjg2OWU0ZjNmZWQ4ODQ2ZWQ2YTgwYTAxN2FhYjMzNjNhYjIyOGEyYTkwMTU0
15
- ZTdkYzUxMGY1ZmU1NzViNWI4ZDQxNTcxYzNjZGY2OTZjZGY3ZDY=
6
+ metadata.gz: b5806484c1dc7fb6fae3c9d69f309197a98652bede1931d80a4f80ddb9e8ffb8bb53c16c0464f3a1a188c4c1485797d7bdf42b3edb8f5e8956ac7a9efe9ed5c6
7
+ data.tar.gz: a63fec5024b5472b9243ef12bcdeba846a3fe717128006608fdbd707f66216379d5a0d4a5ef8758cced0dd7e52cc285d1b9d7e8a69d98eed18153d77062497ec
data/.rubocop.yml CHANGED
@@ -4,7 +4,3 @@ AllCops:
4
4
  - .bundle/**/*
5
5
 
6
6
  inherit_from: .rubocop_todo.yml
7
-
8
- # Enforce Ruby 1.8.7 compatible syntax
9
- HashSyntax:
10
- EnforcedStyle: hash_rockets
data/.rubocop_todo.yml CHANGED
@@ -1,61 +1,44 @@
1
- # This configuration was generated by `rubocop --auto-gen-config`
2
- # on 2015-04-12 19:24:55 +0200 using RuboCop version 0.30.0.
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2016-12-11 21:07:49 +0000 using RuboCop version 0.46.0.
3
4
  # The point is for the user to remove these configuration records
4
5
  # one by one as the offenses are removed from the code base.
5
6
  # Note that changes in the inspected code, or installation of new
6
7
  # versions of RuboCop, may require this file to be generated again.
7
8
 
8
- # Offense count: 23
9
+ # Offense count: 35
9
10
  Metrics/AbcSize:
10
11
  Max: 38
11
12
 
12
13
  # Offense count: 2
13
14
  # Configuration parameters: CountComments.
14
- Metrics/ClassLength:
15
- Max: 150
15
+ Metrics/BlockLength:
16
+ Max: 113
16
17
 
17
18
  # Offense count: 5
19
+ # Configuration parameters: CountComments.
20
+ Metrics/ClassLength:
21
+ Max: 146
22
+
23
+ # Offense count: 6
18
24
  Metrics/CyclomaticComplexity:
19
25
  Max: 9
20
26
 
21
- # Offense count: 92
22
- # Configuration parameters: AllowURI, URISchemes.
27
+ # Offense count: 137
28
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
29
+ # URISchemes: http, https
23
30
  Metrics/LineLength:
24
- Max: 170
31
+ Max: 161
25
32
 
26
- # Offense count: 24
33
+ # Offense count: 44
27
34
  # Configuration parameters: CountComments.
28
35
  Metrics/MethodLength:
29
36
  Max: 31
30
37
 
31
- # Offense count: 4
38
+ # Offense count: 5
32
39
  Metrics/PerceivedComplexity:
33
40
  Max: 11
34
41
 
35
- # Offense count: 1
36
- # Cop supports --auto-correct.
37
- Performance/Sample:
38
- Enabled: false
39
-
40
- # Offense count: 12
41
- # Cop supports --auto-correct.
42
- # Configuration parameters: EnforcedStyle, SupportedStyles.
43
- Style/BarePercentLiterals:
44
- Enabled: false
45
-
46
- # Offense count: 1
47
- Style/CaseEquality:
48
- Enabled: false
49
-
50
- # Offense count: 1
51
- # Configuration parameters: IndentWhenRelativeTo, SupportedStyles, IndentOneStep.
52
- Style/CaseIndentation:
53
- Enabled: false
54
-
55
- # Offense count: 28
42
+ # Offense count: 34
56
43
  Style/Documentation:
57
44
  Enabled: false
58
-
59
- # Bug with this cop https://github.com/bbatsov/rubocop/issues/3283
60
- Lint/ShadowedException:
61
- Enabled: false
data/.travis.yml CHANGED
@@ -2,11 +2,11 @@ sudo: false
2
2
  language: ruby
3
3
  cache: bundler
4
4
  rvm:
5
- - 1.9.3
6
5
  - 2.0.0
7
6
  - 2.1.7
8
7
  - 2.2.4
9
8
  - 2.3.0
9
+ - 2.3.3
10
10
  - ruby-head
11
11
 
12
12
  before_install:
data/CHANGELOG.md CHANGED
@@ -8,6 +8,10 @@ project adheres to [Semantic Versioning][Semver].
8
8
  * WIP - extract plugins to separate gems ...
9
9
  * Your contribution here!
10
10
 
11
+ ## [0.9.0][] (14 December 2016)
12
+ * ditch ruby 1.9 support and upgrade some gems (@matthutchinson #325)
13
+ * term_output plugin added (iTerm2 only) (@ruxton #323)
14
+
11
15
  ## [0.8.1][] (11 October 2016)
12
16
  * shebang fix in installer (@matthutchinson #317)
13
17
  * FlowDock plugin (@mikecrittenden #318)
@@ -255,7 +259,8 @@ project adheres to [Semantic Versioning][Semver].
255
259
  instead of compositing multiply image Caption objects (this seems to be more
256
260
  reliable to not glitch.)
257
261
 
258
- [Unreleased]: https://github.com/mroth/lolcommits/compare/v0.8.1...HEAD
262
+ [Unreleased]: https://github.com/mroth/lolcommits/compare/v0.9.0...HEAD
263
+ [0.9.0]: https://github.com/mroth/lolcommits/compare/v0.8.1...v0.9.0
259
264
  [0.8.1]: https://github.com/mroth/lolcommits/compare/v0.8.0...v0.8.1
260
265
  [0.8.0]: https://github.com/mroth/lolcommits/compare/v0.7.0...v0.8.0
261
266
  [0.7.0]: https://github.com/mroth/lolcommits/compare/v0.6.7...v0.7.0
data/README.md CHANGED
@@ -46,10 +46,11 @@ default MacOSX Ruby install is dumb and requires it.
46
46
  If [Boxen](https://boxen.github.com) is your thing, [try
47
47
  this](https://github.com/AssuredLabor/puppet-lolcommits).
48
48
 
49
- Lolcommits v0.7.0 was the last release to support Ruby < 1.9.3. If you'd like to
49
+ Lolcommits v0.8.1 was the last release to support Ruby < 2.0. If you'd like to
50
50
  use this gem on older rubies, install it with:
51
51
 
52
- [sudo] gem install lolcommits --version 0.7.0
52
+ [sudo] gem install lolcommits --version 0.8.1 # for Ruby 1.9
53
+ [sudo] gem install lolcommits --version 0.7.0 # for Ruby 1.8
53
54
 
54
55
  ### Linux
55
56
 
data/Rakefile CHANGED
@@ -49,7 +49,7 @@ end
49
49
 
50
50
  require 'rubocop/rake_task'
51
51
  RuboCop::RakeTask.new
52
- task :default => [:rubocop, :test, :features]
52
+ task default: [:rubocop, :test, :features]
53
53
 
54
54
  desc 'Migrate an existing local .lolcommits directory to Dropbox'
55
55
  task :dropboxify do
data/bin/lolcommits CHANGED
@@ -36,7 +36,7 @@ end
36
36
  # @return [Lolcommits::Configuration]
37
37
  def configuration
38
38
  if Choice.choices[:test]
39
- Configuration.new(:loldir => Configuration.loldir_for('test'))
39
+ Configuration.new(loldir: Configuration.loldir_for('test'))
40
40
  else
41
41
  Configuration.new
42
42
  end
@@ -75,11 +75,11 @@ def do_capture
75
75
  capture_device = default_device
76
76
 
77
77
  capture_options = {
78
- :capture_delay => capture_delay,
79
- :capture_stealth => capture_stealth,
80
- :capture_device => capture_device,
81
- :capture_animate => capture_animate,
82
- :config => configuration
78
+ capture_delay: capture_delay,
79
+ capture_stealth: capture_stealth,
80
+ capture_device: capture_device,
81
+ capture_animate: capture_animate,
82
+ config: configuration
83
83
  }
84
84
 
85
85
  process_runner = ProcessRunner.new(configuration)
@@ -90,8 +90,8 @@ def do_capture
90
90
 
91
91
  # get optional fake commit msg and sha from command line
92
92
  override_text = {
93
- :message => Choice.choices[:msg],
94
- :sha => Choice.choices[:sha]
93
+ message: Choice.choices[:msg],
94
+ sha: Choice.choices[:sha]
95
95
  }
96
96
 
97
97
  # fire off runner with the overriden fake commit metadata
@@ -11,8 +11,6 @@ include Lolcommits
11
11
  World(PathHelpers)
12
12
 
13
13
  Before do
14
- # Using "announce" causes massive warnings on 1.9.2
15
- @puts = true
16
14
  @aruba_timeout_seconds = 20
17
15
 
18
16
  # prevent launchy from opening gifs in tests
data/lib/lolcommits.rb CHANGED
@@ -34,6 +34,7 @@ require 'lolcommits/plugins/dot_com'
34
34
  require 'lolcommits/plugins/tranzlate'
35
35
  require 'lolcommits/plugins/lol_twitter'
36
36
  require 'lolcommits/plugins/uploldz'
37
+ require 'lolcommits/plugins/term_output'
37
38
  require 'lolcommits/plugins/lolsrv'
38
39
  require 'lolcommits/plugins/lol_yammer'
39
40
  require 'lolcommits/plugins/lol_protonet'
@@ -44,22 +44,20 @@ module Lolcommits
44
44
  end
45
45
 
46
46
  # check for a error condition with git config affecting ruby-git
47
- if Platform.git_config_color_always?
48
- fatal 'Due to a bug in the ruby-git library, git config for color.ui'\
49
- " cannot be set to 'always'."
50
- fatal "Try setting it to 'auto' instead!"
51
- exit 1
52
- end
47
+ return unless Platform.git_config_color_always?
48
+ fatal 'Due to a bug in the ruby-git library, git config for color.ui'\
49
+ " cannot be set to 'always'."
50
+ fatal "Try setting it to 'auto' instead!"
51
+ exit 1
53
52
  end
54
53
 
55
54
  # Die with an informative error message if ffmpeg is not installed.
56
55
  # This is only used for certain functions (such as animation), so only run
57
56
  # this when you know the user wants to perform one of them.
58
57
  def self.die_if_no_valid_ffmpeg_installed!
59
- unless Platform.valid_ffmpeg_installed?
60
- fatal 'FATAL: ffmpeg does not appear to be properly installed!'
61
- exit 1
62
- end
58
+ return if Platform.valid_ffmpeg_installed?
59
+ fatal 'FATAL: ffmpeg does not appear to be properly installed!'
60
+ exit 1
63
61
  end
64
62
 
65
63
  # If we are not in a git repo, we can't do git related things!
@@ -118,10 +118,9 @@ module Lolcommits
118
118
  # @return String
119
119
  def self.device_list
120
120
  # TODO: handle other platforms here (linux/windows)
121
- if Platform.platform_mac?
122
- capturer = Lolcommits::CaptureMacAnimated.new
123
- `#{capturer.executable_path} -l`
124
- end
121
+ return unless Platform.platform_mac?
122
+ capturer = Lolcommits::CaptureMacAnimated.new
123
+ `#{capturer.executable_path} -l`
125
124
  end
126
125
  end
127
126
  end
@@ -61,9 +61,9 @@ module Lolcommits
61
61
 
62
62
  def parse_user_input(str)
63
63
  # cater for bools, strings, ints and blanks
64
- if 'true'.casecmp(str) == 0
64
+ if 'true'.casecmp(str).zero?
65
65
  true
66
- elsif 'false'.casecmp(str) == 0
66
+ elsif 'false'.casecmp(str).zero?
67
67
  false
68
68
  elsif str =~ /^[0-9]+$/
69
69
  str.to_i
@@ -16,17 +16,17 @@ module Lolcommits
16
16
  t = Time.now.to_i.to_s
17
17
  HTTMultiParty.post(
18
18
  "#{BASE_URL}/git_commits.json",
19
- :body => {
20
- :git_commit => {
21
- :sha => runner.sha,
22
- :repo_external_id => configuration['repo_id'],
23
- :image => File.open(runner.main_image),
24
- :raw => File.open(runner.snapshot_loc)
19
+ body: {
20
+ git_commit: {
21
+ sha: runner.sha,
22
+ repo_external_id: configuration['repo_id'],
23
+ image: File.open(runner.main_image),
24
+ raw: File.open(runner.snapshot_loc)
25
25
  },
26
26
 
27
- :key => configuration['api_key'],
28
- :t => t,
29
- :token => Digest::SHA1.hexdigest(configuration['api_secret'] + t)
27
+ key: configuration['api_key'],
28
+ t: t,
29
+ token: Digest::SHA1.hexdigest(configuration['api_secret'] + t)
30
30
  }
31
31
  )
32
32
  rescue => e
@@ -54,8 +54,8 @@ module Lolcommits
54
54
  endpoint = 'https://' + configuration['access_token'] + '@' + ENDPOINT_URL + configuration['organization'] + '/' + configuration['flow'] + '/messages'
55
55
  response = RestClient.post(
56
56
  endpoint,
57
- :event => 'file',
58
- :content => File.new(runner.main_image)
57
+ event: 'file',
58
+ content: File.new(runner.main_image)
59
59
  )
60
60
  debug response
61
61
  rescue => e
@@ -57,7 +57,7 @@ module Lolcommits
57
57
  end
58
58
 
59
59
  def message_json
60
- { :message => message }.to_json.force_encoding('utf-8')
60
+ { message: message }.to_json.force_encoding('utf-8')
61
61
  end
62
62
 
63
63
  def picture_part
@@ -15,8 +15,8 @@ module Lolcommits
15
15
  RestClient.post(
16
16
  api_url,
17
17
  {
18
- :files => [File.new(runner.main_image)],
19
- :message => message
18
+ files: [File.new(runner.main_image)],
19
+ message: message
20
20
  },
21
21
  'X-Protonet-Token' => configuration['api_token']
22
22
  )
@@ -48,12 +48,12 @@ module Lolcommits
48
48
 
49
49
  response = RestClient.post(
50
50
  ENDPOINT_URL,
51
- :file => File.new(runner.main_image),
52
- :token => configuration['access_token'],
53
- :filetype => 'jpg',
54
- :filename => runner.sha,
55
- :title => runner.message + "[#{runner.vcs_info.repo}]",
56
- :channels => configuration['channels']
51
+ file: File.new(runner.main_image),
52
+ token: configuration['access_token'],
53
+ filetype: 'jpg',
54
+ filename: runner.sha,
55
+ title: runner.message + "[#{runner.vcs_info.repo}]",
56
+ channels: configuration['channels']
57
57
  )
58
58
 
59
59
  debug response
@@ -14,7 +14,7 @@ module Lolcommits
14
14
  def run_postcapture
15
15
  return unless valid_configuration?
16
16
  puts 'Posting to Tumblr'
17
- r = client.photo(configuration['tumblr_name'], :data => runner.main_image)
17
+ r = client.photo(configuration['tumblr_name'], data: runner.main_image)
18
18
  if r.key?('id')
19
19
  puts "\t--> Post successful!"
20
20
  else
@@ -40,16 +40,16 @@ module Lolcommits
40
40
  puts 'Need to grab tumblr tokens'
41
41
  puts '---------------------------'
42
42
 
43
- request_token = oauth_consumer.get_request_token(:exclude_callback => true)
43
+ request_token = oauth_consumer.get_request_token(exclude_callback: true)
44
44
  print "\n1) Please open this url in your browser to authorize lolcommits:\n\n"
45
45
  puts request_token.authorize_url
46
46
  print "\n2) Launching a local server to complete the OAuth authentication process:\n\n"
47
47
  begin
48
- server = WEBrick::HTTPServer.new :Port => 3000
48
+ server = WEBrick::HTTPServer.new Port: 3000
49
49
  server.mount_proc '/', server_callback(server)
50
50
  server.start
51
51
  debug "Requesting Tumblr OAuth Token with verifier: #{@verifier}"
52
- access_token = request_token.get_access_token(:oauth_verifier => @verifier)
52
+ access_token = request_token.get_access_token(oauth_verifier: @verifier)
53
53
  rescue Errno::EADDRINUSE
54
54
  puts "\nERROR You have something running on port 3000. Please turn it off to complete the authorization process"
55
55
  return
@@ -82,10 +82,10 @@ module Lolcommits
82
82
 
83
83
  def client
84
84
  @client ||= Tumblr.new(
85
- :consumer_key => TUMBLR_CONSUMER_KEY,
86
- :consumer_secret => TUMBLR_CONSUMER_SECRET,
87
- :oauth_token => configuration['access_token'],
88
- :oauth_token_secret => configuration['secret']
85
+ consumer_key: TUMBLR_CONSUMER_KEY,
86
+ consumer_secret: TUMBLR_CONSUMER_SECRET,
87
+ oauth_token: configuration['access_token'],
88
+ oauth_token_secret: configuration['secret']
89
89
  )
90
90
  end
91
91
 
@@ -93,9 +93,9 @@ module Lolcommits
93
93
  @oauth_consumer ||= OAuth::Consumer.new(
94
94
  TUMBLR_CONSUMER_KEY,
95
95
  TUMBLR_CONSUMER_SECRET,
96
- :site => TUMBLR_API_ENDPOINT,
97
- :request_endpoint => TUMBLR_API_ENDPOINT,
98
- :http_method => :get
96
+ site: TUMBLR_API_ENDPOINT,
97
+ request_endpoint: TUMBLR_API_ENDPOINT,
98
+ http_method: :get
99
99
  )
100
100
  end
101
101
 
@@ -78,7 +78,7 @@ module Lolcommits
78
78
  begin
79
79
  debug "Requesting Twitter OAuth Token with PIN: #{twitter_pin}"
80
80
  OAuth::RequestToken.new(oauth_consumer, rtoken, rsecret)
81
- access_token = request_token.get_access_token(:oauth_verifier => twitter_pin)
81
+ access_token = request_token.get_access_token(oauth_verifier: twitter_pin)
82
82
  rescue OAuth::Unauthorized
83
83
  puts "\nERROR: Twitter PIN Auth FAILED!"
84
84
  return
@@ -126,9 +126,9 @@ module Lolcommits
126
126
  @oauth_consumer ||= OAuth::Consumer.new(
127
127
  TWITTER_CONSUMER_KEY,
128
128
  TWITTER_CONSUMER_SECRET,
129
- :site => TWITTER_API_ENDPOINT,
130
- :request_endpoint => TWITTER_API_ENDPOINT,
131
- :sign_in => true
129
+ site: TWITTER_API_ENDPOINT,
130
+ request_endpoint: TWITTER_API_ENDPOINT,
131
+ sign_in: true
132
132
  )
133
133
  end
134
134
 
@@ -65,12 +65,12 @@ module Lolcommits
65
65
  c.client_secret = YAMMER_CLIENT_SECRET
66
66
  end
67
67
 
68
- client = Yammer::Client.new(:access_token => configuration['access_token'])
68
+ client = Yammer::Client.new(access_token: configuration['access_token'])
69
69
 
70
70
  retries = YAMMER_RETRY_COUNT
71
71
  begin
72
72
  lolimage = File.new(runner.main_image)
73
- response = client.create_message(post, :attachment1 => lolimage)
73
+ response = client.create_message(post, attachment1: lolimage)
74
74
  debug response.body.inspect
75
75
  puts "\t--> Status posted!" if response
76
76
  rescue => e
@@ -38,11 +38,11 @@ module Lolcommits
38
38
 
39
39
  def upload(file, sha)
40
40
  RestClient.post(configuration['server'] + '/uplol',
41
- :lol => File.new(file),
42
- :url => runner.vcs_info.url + sha,
43
- :repo => runner.vcs_info.repo,
44
- :date => File.ctime(file),
45
- :sha => sha)
41
+ lol: File.new(file),
42
+ url: runner.vcs_info.url + sha,
43
+ repo: runner.vcs_info.repo,
44
+ date: File.ctime(file),
45
+ sha: sha)
46
46
  rescue => e
47
47
  log_error(e, "ERROR: Upload of lol #{sha} FAILED #{e.class} - #{e.message}")
48
48
  end
@@ -100,30 +100,30 @@ module Lolcommits
100
100
 
101
101
  def config_defaults
102
102
  {
103
- :message => {
104
- :color => 'white',
105
- :font => DEFAULT_FONT_PATH,
106
- :position => 'SW',
107
- :size => 48,
108
- :stroke_color => 'black',
109
- :uppercase => false
103
+ message: {
104
+ color: 'white',
105
+ font: DEFAULT_FONT_PATH,
106
+ position: 'SW',
107
+ size: 48,
108
+ stroke_color: 'black',
109
+ uppercase: false
110
110
  },
111
- :sha => {
112
- :color => 'white',
113
- :font => DEFAULT_FONT_PATH,
114
- :position => 'NE',
115
- :size => 32,
116
- :stroke_color => 'black',
117
- :uppercase => false
111
+ sha: {
112
+ color: 'white',
113
+ font: DEFAULT_FONT_PATH,
114
+ position: 'NE',
115
+ size: 32,
116
+ stroke_color: 'black',
117
+ uppercase: false
118
118
  },
119
- :overlay => {
120
- :enabled => false,
121
- :overlay_colors => [
119
+ overlay: {
120
+ enabled: false,
121
+ overlay_colors: [
122
122
  '#2e4970', '#674685', '#ca242f', '#1e7882', '#2884ae', '#4ba000',
123
123
  '#187296', '#7e231f', '#017d9f', '#e52d7b', '#0f5eaa', '#e40087',
124
124
  '#5566ac', '#ed8833', '#f8991c', '#408c93', '#ba9109'
125
125
  ],
126
- :overlay_percent => 50
126
+ overlay_percent: 50
127
127
  }
128
128
  }
129
129
  end
@@ -0,0 +1,54 @@
1
+ # -*- encoding : utf-8 -*-
2
+ require 'base64'
3
+
4
+ module Lolcommits
5
+ class TermOutput < Plugin
6
+ def run_postcapture
7
+ if terminal_supported?
8
+ if !runner.vcs_info || runner.vcs_info.repo.empty?
9
+ debug 'repo is empty, skipping term output'
10
+ else
11
+ base64 = Base64.encode64(open(runner.main_image, &:read))
12
+ puts "#{begin_escape}1337;File=inline=1:#{base64};alt=#{runner.message};#{end_escape}\n"
13
+ end
14
+ else
15
+ debug 'Disabled, your terminal is not supported (requires iTerm2)'
16
+ end
17
+ end
18
+
19
+ def self.name
20
+ 'term_output'
21
+ end
22
+
23
+ def self.runner_order
24
+ :postcapture
25
+ end
26
+
27
+ def configure_options!
28
+ if terminal_supported?
29
+ super
30
+ else
31
+ puts "Sorry, your terminal does not support the #{self.class.name} plugin (requires iTerm2)"
32
+ end
33
+ end
34
+
35
+ private
36
+
37
+ # escape sequences for tmux sessions differ
38
+ def begin_escape
39
+ tmux? ? "\033Ptmux;\033\033]" : "\033]"
40
+ end
41
+
42
+ def end_escape
43
+ tmux? ? "\a\033\\" : "\a"
44
+ end
45
+
46
+ def tmux?
47
+ !ENV['TMUX'].nil?
48
+ end
49
+
50
+ def terminal_supported?
51
+ ENV['TERM_PROGRAM'] =~ /iTerm/
52
+ end
53
+ end
54
+ end
@@ -83,8 +83,7 @@ module Lolspeak
83
83
  def tranzlate(str)
84
84
  lolstr = str.dup
85
85
  LOL_DICTIONARY.each do |english, lolspeak|
86
- # ghetto ruby1.8/1.9 agnostic version of choice vs sample
87
- lolstr.gsub!(english, lolspeak.shuffle.first)
86
+ lolstr.gsub!(english, lolspeak.sample)
88
87
  end
89
88
 
90
89
  lolstr << '! kthxbye!' if rand(10) == 2
@@ -28,15 +28,15 @@ module Lolcommits
28
28
  RestClient.post(
29
29
  configuration['endpoint'],
30
30
  {
31
- :file => File.new(runner.main_image),
32
- :message => runner.message,
33
- :repo => runner.vcs_info.repo,
34
- :author_name => runner.vcs_info.author_name,
35
- :author_email => runner.vcs_info.author_email,
36
- :sha => runner.sha,
37
- :key => configuration['optional_key']
31
+ file: File.new(runner.main_image),
32
+ message: runner.message,
33
+ repo: runner.vcs_info.repo,
34
+ author_name: runner.vcs_info.author_name,
35
+ author_email: runner.vcs_info.author_email,
36
+ sha: runner.sha,
37
+ key: configuration['optional_key']
38
38
  },
39
- :Authorization => authorization_header
39
+ Authorization: authorization_header
40
40
  )
41
41
  end
42
42
  rescue => e
@@ -86,12 +86,12 @@ module Lolcommits
86
86
  self.main_image = config.main_image(sha, image_file_type)
87
87
 
88
88
  capturer = Platform.capturer_class(animate?).new(
89
- :capture_device => capture_device,
90
- :capture_delay => capture_delay,
91
- :snapshot_location => snapshot_loc,
92
- :video_location => config.video_loc,
93
- :frames_location => config.frames_loc,
94
- :animated_duration => capture_animate
89
+ capture_device: capture_device,
90
+ capture_delay: capture_delay,
91
+ snapshot_location: snapshot_loc,
92
+ video_location: config.video_loc,
93
+ frames_location: config.frames_loc,
94
+ animated_duration: capture_animate
95
95
  )
96
96
  capturer.capture
97
97
  end
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Lolcommits
3
- VERSION = '0.8.1'.freeze
3
+ VERSION = '0.9.0'.freeze
4
4
  end
data/lolcommits.gemspec CHANGED
@@ -24,43 +24,38 @@ Gem::Specification.new do |s|
24
24
  s.require_paths = ['lib']
25
25
 
26
26
  # non-gem dependencies
27
- s.required_ruby_version = '>= 1.9.3'
27
+ s.required_ruby_version = '>= 2.0'
28
28
  s.requirements << 'imagemagick'
29
29
  s.requirements << 'a webcam'
30
30
 
31
31
  # hold back upgrading (and why)
32
- s.add_runtime_dependency('rest-client', '=1.8') # yam gem requires uses this older version
33
- s.add_runtime_dependency('mime-types', '=2.99') # ~> 3.0+ requires Ruby >= 2.0
34
- s.add_runtime_dependency('json', '=1.8.3') # ~> 2.0+ requires Ruby >= 2.0 (lolsrv)
35
- s.add_development_dependency('tins', '=1.6.0') # ~> 1.7.0+ requires Ruby >= 2.0
36
- s.add_development_dependency('aruba', '=0.6.2') # upgrading requires a lot of test code changes
37
- s.add_development_dependency('rake', '=10.5.0') # ~> 11+ introduces lots of warnings from other deps
38
- s.add_runtime_dependency('term-ansicolor', '=1.3.2') # ~> 1.4+ requires Ruby >= 2.0
39
- s.add_runtime_dependency('net-http-persistent', '=2.9.4') # ~> 3.0+ requires Ruby >= 2.1
32
+ s.add_development_dependency('aruba', '=0.6.2') # upgrading requires a lot of test code changes
33
+ s.add_development_dependency('rake', '=10.5.0') # ~> 11+ introduces lots of warnings from other deps
34
+ s.add_runtime_dependency('twitter', '~> 5.17.0') # twitter 6+ requires higher faraday
35
+ s.add_runtime_dependency('net-http-persistent', '=2.9.4') # ~> 3+ requires Ruby 2.1
40
36
 
41
37
  # core
42
- s.add_runtime_dependency('methadone', '~> 1.9.2')
38
+ s.add_runtime_dependency('methadone', '~> 1.9.3')
43
39
  s.add_runtime_dependency('choice', '~> 0.2.0')
44
40
  s.add_runtime_dependency('mercurial-ruby', '~> 0.7.12')
45
- s.add_runtime_dependency('mini_magick', '~> 4.5.1')
41
+ s.add_runtime_dependency('mini_magick', '~> 4.6.0')
46
42
  s.add_runtime_dependency('launchy', '~> 2.4.3')
47
43
  s.add_runtime_dependency('open4', '~> 1.3.4')
48
44
  s.add_runtime_dependency('git', '~> 1.3.0')
49
45
 
50
46
  # plugin gems
51
- s.add_runtime_dependency('twitter', '~> 5.16.0') # twitter
52
47
  s.add_runtime_dependency('yam', '~> 2.5.0') # yammer
53
48
  s.add_runtime_dependency('httmultiparty', '~> 0.3.16') # dot_com
54
49
  s.add_runtime_dependency('tumblr_client', '~> 0.8.5') # tumblr
55
50
 
56
51
  # development gems
57
- s.add_development_dependency('rdoc', '~> 4.2.2')
52
+ s.add_development_dependency('rdoc', '~> 5.0.0')
58
53
 
59
54
  # testing gems
60
- s.add_development_dependency('rubocop', '~> 0.41.0')
61
- s.add_development_dependency('travis', '~> 1.8.2')
62
- s.add_development_dependency('minitest', '~> 5.9.0')
63
- s.add_development_dependency('coveralls', '~> 0.8.14')
64
- s.add_development_dependency('ffaker', '~> 2.2.0')
55
+ s.add_development_dependency('rubocop', '~> 0.46.0')
56
+ s.add_development_dependency('travis', '~> 1.8.5')
57
+ s.add_development_dependency('minitest', '~> 5.10.1')
58
+ s.add_development_dependency('coveralls', '~> 0.8.17')
59
+ s.add_development_dependency('ffaker', '~> 2.3.0')
65
60
  s.add_development_dependency('cucumber', '~> 2.4.0')
66
61
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lolcommits
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Rothenberg
@@ -9,64 +9,8 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-10-11 00:00:00.000000000 Z
12
+ date: 2016-12-14 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: rest-client
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - '='
19
- - !ruby/object:Gem::Version
20
- version: '1.8'
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - '='
26
- - !ruby/object:Gem::Version
27
- version: '1.8'
28
- - !ruby/object:Gem::Dependency
29
- name: mime-types
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - '='
33
- - !ruby/object:Gem::Version
34
- version: '2.99'
35
- type: :runtime
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - '='
40
- - !ruby/object:Gem::Version
41
- version: '2.99'
42
- - !ruby/object:Gem::Dependency
43
- name: json
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - '='
47
- - !ruby/object:Gem::Version
48
- version: 1.8.3
49
- type: :runtime
50
- prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - '='
54
- - !ruby/object:Gem::Version
55
- version: 1.8.3
56
- - !ruby/object:Gem::Dependency
57
- name: tins
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - '='
61
- - !ruby/object:Gem::Version
62
- version: 1.6.0
63
- type: :development
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - '='
68
- - !ruby/object:Gem::Version
69
- version: 1.6.0
70
14
  - !ruby/object:Gem::Dependency
71
15
  name: aruba
72
16
  requirement: !ruby/object:Gem::Requirement
@@ -96,19 +40,19 @@ dependencies:
96
40
  - !ruby/object:Gem::Version
97
41
  version: 10.5.0
98
42
  - !ruby/object:Gem::Dependency
99
- name: term-ansicolor
43
+ name: twitter
100
44
  requirement: !ruby/object:Gem::Requirement
101
45
  requirements:
102
- - - '='
46
+ - - "~>"
103
47
  - !ruby/object:Gem::Version
104
- version: 1.3.2
48
+ version: 5.17.0
105
49
  type: :runtime
106
50
  prerelease: false
107
51
  version_requirements: !ruby/object:Gem::Requirement
108
52
  requirements:
109
- - - '='
53
+ - - "~>"
110
54
  - !ruby/object:Gem::Version
111
- version: 1.3.2
55
+ version: 5.17.0
112
56
  - !ruby/object:Gem::Dependency
113
57
  name: net-http-persistent
114
58
  requirement: !ruby/object:Gem::Requirement
@@ -127,257 +71,244 @@ dependencies:
127
71
  name: methadone
128
72
  requirement: !ruby/object:Gem::Requirement
129
73
  requirements:
130
- - - ~>
74
+ - - "~>"
131
75
  - !ruby/object:Gem::Version
132
- version: 1.9.2
76
+ version: 1.9.3
133
77
  type: :runtime
134
78
  prerelease: false
135
79
  version_requirements: !ruby/object:Gem::Requirement
136
80
  requirements:
137
- - - ~>
81
+ - - "~>"
138
82
  - !ruby/object:Gem::Version
139
- version: 1.9.2
83
+ version: 1.9.3
140
84
  - !ruby/object:Gem::Dependency
141
85
  name: choice
142
86
  requirement: !ruby/object:Gem::Requirement
143
87
  requirements:
144
- - - ~>
88
+ - - "~>"
145
89
  - !ruby/object:Gem::Version
146
90
  version: 0.2.0
147
91
  type: :runtime
148
92
  prerelease: false
149
93
  version_requirements: !ruby/object:Gem::Requirement
150
94
  requirements:
151
- - - ~>
95
+ - - "~>"
152
96
  - !ruby/object:Gem::Version
153
97
  version: 0.2.0
154
98
  - !ruby/object:Gem::Dependency
155
99
  name: mercurial-ruby
156
100
  requirement: !ruby/object:Gem::Requirement
157
101
  requirements:
158
- - - ~>
102
+ - - "~>"
159
103
  - !ruby/object:Gem::Version
160
104
  version: 0.7.12
161
105
  type: :runtime
162
106
  prerelease: false
163
107
  version_requirements: !ruby/object:Gem::Requirement
164
108
  requirements:
165
- - - ~>
109
+ - - "~>"
166
110
  - !ruby/object:Gem::Version
167
111
  version: 0.7.12
168
112
  - !ruby/object:Gem::Dependency
169
113
  name: mini_magick
170
114
  requirement: !ruby/object:Gem::Requirement
171
115
  requirements:
172
- - - ~>
116
+ - - "~>"
173
117
  - !ruby/object:Gem::Version
174
- version: 4.5.1
118
+ version: 4.6.0
175
119
  type: :runtime
176
120
  prerelease: false
177
121
  version_requirements: !ruby/object:Gem::Requirement
178
122
  requirements:
179
- - - ~>
123
+ - - "~>"
180
124
  - !ruby/object:Gem::Version
181
- version: 4.5.1
125
+ version: 4.6.0
182
126
  - !ruby/object:Gem::Dependency
183
127
  name: launchy
184
128
  requirement: !ruby/object:Gem::Requirement
185
129
  requirements:
186
- - - ~>
130
+ - - "~>"
187
131
  - !ruby/object:Gem::Version
188
132
  version: 2.4.3
189
133
  type: :runtime
190
134
  prerelease: false
191
135
  version_requirements: !ruby/object:Gem::Requirement
192
136
  requirements:
193
- - - ~>
137
+ - - "~>"
194
138
  - !ruby/object:Gem::Version
195
139
  version: 2.4.3
196
140
  - !ruby/object:Gem::Dependency
197
141
  name: open4
198
142
  requirement: !ruby/object:Gem::Requirement
199
143
  requirements:
200
- - - ~>
144
+ - - "~>"
201
145
  - !ruby/object:Gem::Version
202
146
  version: 1.3.4
203
147
  type: :runtime
204
148
  prerelease: false
205
149
  version_requirements: !ruby/object:Gem::Requirement
206
150
  requirements:
207
- - - ~>
151
+ - - "~>"
208
152
  - !ruby/object:Gem::Version
209
153
  version: 1.3.4
210
154
  - !ruby/object:Gem::Dependency
211
155
  name: git
212
156
  requirement: !ruby/object:Gem::Requirement
213
157
  requirements:
214
- - - ~>
158
+ - - "~>"
215
159
  - !ruby/object:Gem::Version
216
160
  version: 1.3.0
217
161
  type: :runtime
218
162
  prerelease: false
219
163
  version_requirements: !ruby/object:Gem::Requirement
220
164
  requirements:
221
- - - ~>
165
+ - - "~>"
222
166
  - !ruby/object:Gem::Version
223
167
  version: 1.3.0
224
- - !ruby/object:Gem::Dependency
225
- name: twitter
226
- requirement: !ruby/object:Gem::Requirement
227
- requirements:
228
- - - ~>
229
- - !ruby/object:Gem::Version
230
- version: 5.16.0
231
- type: :runtime
232
- prerelease: false
233
- version_requirements: !ruby/object:Gem::Requirement
234
- requirements:
235
- - - ~>
236
- - !ruby/object:Gem::Version
237
- version: 5.16.0
238
168
  - !ruby/object:Gem::Dependency
239
169
  name: yam
240
170
  requirement: !ruby/object:Gem::Requirement
241
171
  requirements:
242
- - - ~>
172
+ - - "~>"
243
173
  - !ruby/object:Gem::Version
244
174
  version: 2.5.0
245
175
  type: :runtime
246
176
  prerelease: false
247
177
  version_requirements: !ruby/object:Gem::Requirement
248
178
  requirements:
249
- - - ~>
179
+ - - "~>"
250
180
  - !ruby/object:Gem::Version
251
181
  version: 2.5.0
252
182
  - !ruby/object:Gem::Dependency
253
183
  name: httmultiparty
254
184
  requirement: !ruby/object:Gem::Requirement
255
185
  requirements:
256
- - - ~>
186
+ - - "~>"
257
187
  - !ruby/object:Gem::Version
258
188
  version: 0.3.16
259
189
  type: :runtime
260
190
  prerelease: false
261
191
  version_requirements: !ruby/object:Gem::Requirement
262
192
  requirements:
263
- - - ~>
193
+ - - "~>"
264
194
  - !ruby/object:Gem::Version
265
195
  version: 0.3.16
266
196
  - !ruby/object:Gem::Dependency
267
197
  name: tumblr_client
268
198
  requirement: !ruby/object:Gem::Requirement
269
199
  requirements:
270
- - - ~>
200
+ - - "~>"
271
201
  - !ruby/object:Gem::Version
272
202
  version: 0.8.5
273
203
  type: :runtime
274
204
  prerelease: false
275
205
  version_requirements: !ruby/object:Gem::Requirement
276
206
  requirements:
277
- - - ~>
207
+ - - "~>"
278
208
  - !ruby/object:Gem::Version
279
209
  version: 0.8.5
280
210
  - !ruby/object:Gem::Dependency
281
211
  name: rdoc
282
212
  requirement: !ruby/object:Gem::Requirement
283
213
  requirements:
284
- - - ~>
214
+ - - "~>"
285
215
  - !ruby/object:Gem::Version
286
- version: 4.2.2
216
+ version: 5.0.0
287
217
  type: :development
288
218
  prerelease: false
289
219
  version_requirements: !ruby/object:Gem::Requirement
290
220
  requirements:
291
- - - ~>
221
+ - - "~>"
292
222
  - !ruby/object:Gem::Version
293
- version: 4.2.2
223
+ version: 5.0.0
294
224
  - !ruby/object:Gem::Dependency
295
225
  name: rubocop
296
226
  requirement: !ruby/object:Gem::Requirement
297
227
  requirements:
298
- - - ~>
228
+ - - "~>"
299
229
  - !ruby/object:Gem::Version
300
- version: 0.41.0
230
+ version: 0.46.0
301
231
  type: :development
302
232
  prerelease: false
303
233
  version_requirements: !ruby/object:Gem::Requirement
304
234
  requirements:
305
- - - ~>
235
+ - - "~>"
306
236
  - !ruby/object:Gem::Version
307
- version: 0.41.0
237
+ version: 0.46.0
308
238
  - !ruby/object:Gem::Dependency
309
239
  name: travis
310
240
  requirement: !ruby/object:Gem::Requirement
311
241
  requirements:
312
- - - ~>
242
+ - - "~>"
313
243
  - !ruby/object:Gem::Version
314
- version: 1.8.2
244
+ version: 1.8.5
315
245
  type: :development
316
246
  prerelease: false
317
247
  version_requirements: !ruby/object:Gem::Requirement
318
248
  requirements:
319
- - - ~>
249
+ - - "~>"
320
250
  - !ruby/object:Gem::Version
321
- version: 1.8.2
251
+ version: 1.8.5
322
252
  - !ruby/object:Gem::Dependency
323
253
  name: minitest
324
254
  requirement: !ruby/object:Gem::Requirement
325
255
  requirements:
326
- - - ~>
256
+ - - "~>"
327
257
  - !ruby/object:Gem::Version
328
- version: 5.9.0
258
+ version: 5.10.1
329
259
  type: :development
330
260
  prerelease: false
331
261
  version_requirements: !ruby/object:Gem::Requirement
332
262
  requirements:
333
- - - ~>
263
+ - - "~>"
334
264
  - !ruby/object:Gem::Version
335
- version: 5.9.0
265
+ version: 5.10.1
336
266
  - !ruby/object:Gem::Dependency
337
267
  name: coveralls
338
268
  requirement: !ruby/object:Gem::Requirement
339
269
  requirements:
340
- - - ~>
270
+ - - "~>"
341
271
  - !ruby/object:Gem::Version
342
- version: 0.8.14
272
+ version: 0.8.17
343
273
  type: :development
344
274
  prerelease: false
345
275
  version_requirements: !ruby/object:Gem::Requirement
346
276
  requirements:
347
- - - ~>
277
+ - - "~>"
348
278
  - !ruby/object:Gem::Version
349
- version: 0.8.14
279
+ version: 0.8.17
350
280
  - !ruby/object:Gem::Dependency
351
281
  name: ffaker
352
282
  requirement: !ruby/object:Gem::Requirement
353
283
  requirements:
354
- - - ~>
284
+ - - "~>"
355
285
  - !ruby/object:Gem::Version
356
- version: 2.2.0
286
+ version: 2.3.0
357
287
  type: :development
358
288
  prerelease: false
359
289
  version_requirements: !ruby/object:Gem::Requirement
360
290
  requirements:
361
- - - ~>
291
+ - - "~>"
362
292
  - !ruby/object:Gem::Version
363
- version: 2.2.0
293
+ version: 2.3.0
364
294
  - !ruby/object:Gem::Dependency
365
295
  name: cucumber
366
296
  requirement: !ruby/object:Gem::Requirement
367
297
  requirements:
368
- - - ~>
298
+ - - "~>"
369
299
  - !ruby/object:Gem::Version
370
300
  version: 2.4.0
371
301
  type: :development
372
302
  prerelease: false
373
303
  version_requirements: !ruby/object:Gem::Requirement
374
304
  requirements:
375
- - - ~>
305
+ - - "~>"
376
306
  - !ruby/object:Gem::Version
377
307
  version: 2.4.0
378
- description: ! " lolcommits takes a snapshot with your webcam every time you git
379
- commit code,\n and archives a lolcat style image with it. It's selfies for software\n
380
- \ developers. `git blame` has never been so much fun.\n"
308
+ description: |2
309
+ lolcommits takes a snapshot with your webcam every time you git commit code,
310
+ and archives a lolcat style image with it. It's selfies for software
311
+ developers. `git blame` has never been so much fun.
381
312
  email:
382
313
  - mrothenberg@gmail.com
383
314
  - matt@hiddenloop.com
@@ -386,13 +317,13 @@ executables:
386
317
  extensions: []
387
318
  extra_rdoc_files: []
388
319
  files:
389
- - .coveralls.yml
390
- - .editorconfig
391
- - .gitattributes
392
- - .gitignore
393
- - .rubocop.yml
394
- - .rubocop_todo.yml
395
- - .travis.yml
320
+ - ".coveralls.yml"
321
+ - ".editorconfig"
322
+ - ".gitattributes"
323
+ - ".gitignore"
324
+ - ".rubocop.yml"
325
+ - ".rubocop_todo.yml"
326
+ - ".travis.yml"
396
327
  - CHANGELOG.md
397
328
  - CODE_OF_CONDUCT.md
398
329
  - CONTRIBUTING.md
@@ -445,6 +376,7 @@ files:
445
376
  - lib/lolcommits/plugins/lol_yammer.rb
446
377
  - lib/lolcommits/plugins/lolsrv.rb
447
378
  - lib/lolcommits/plugins/loltext.rb
379
+ - lib/lolcommits/plugins/term_output.rb
448
380
  - lib/lolcommits/plugins/tranzlate.rb
449
381
  - lib/lolcommits/plugins/uploldz.rb
450
382
  - lib/lolcommits/runner.rb
@@ -471,12 +403,12 @@ require_paths:
471
403
  - lib
472
404
  required_ruby_version: !ruby/object:Gem::Requirement
473
405
  requirements:
474
- - - ! '>='
406
+ - - ">="
475
407
  - !ruby/object:Gem::Version
476
- version: 1.9.3
408
+ version: '2.0'
477
409
  required_rubygems_version: !ruby/object:Gem::Requirement
478
410
  requirements:
479
- - - ! '>='
411
+ - - ">="
480
412
  - !ruby/object:Gem::Version
481
413
  version: '0'
482
414
  requirements: