misfortune 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: 0c947d845f1f0c65cba013aa407e2511cada500a
4
- data.tar.gz: 38ef7871639921e724fc944c3ab9f6fcaa382584
3
+ metadata.gz: 941294a0580f770ad921b064c2a0dd61ed1f684e
4
+ data.tar.gz: 98178acdc061a85f69c3b4b317569ff0da8b81dd
5
5
  SHA512:
6
- metadata.gz: 432f2a80901bf6cedfd7fd74ac5bdfeedb9d5ff05995993118d4e4c589dbfb5316603ece312875b960c655b39b7316f5c7fa1f0844758b36f8590ded2e9d92c9
7
- data.tar.gz: 664677cdd2f264920720f28db4648dada26e814b74306e3db4e70950e800957b4c8150e07729ab8fec7bba9392ec5b81d2e6f49c2619966dffd2e7fffdd35a15
6
+ metadata.gz: b85c5fdbc926d0c4e687f1a4ef5fc2237d7322d36cf373dbd9ae50ded00e114ed54a350560ffb541f44e53de868faeebd27fa29e96782ac407932fce8fc5a223
7
+ data.tar.gz: bd508866efd0c9e4854676be422a542f677a0aed4851fc6e68dbeebca3cbf4129c3c74e76dd859f9c3f5e2e00cea70112a39a87d7a53a27cd945cb95db77ee18
@@ -0,0 +1,21 @@
1
+ ---
2
+ engines:
3
+ duplication:
4
+ enabled: true
5
+ config:
6
+ languages:
7
+ - ruby
8
+ - javascript
9
+ fixme:
10
+ enabled: true
11
+ rubocop:
12
+ enabled: true
13
+ exclude_fingerprints:
14
+ - 05f617ddb612ba4687d9e9bdd884afa3
15
+ ratings:
16
+ paths:
17
+ - "**.js"
18
+ - "**.rb"
19
+ exclude_paths:
20
+ - spec/
21
+ - "**.md"
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/misfortune.svg)](https://badge.fury.io/rb/misfortune)
2
- [![Build Status](https://travis-ci.com/nbekirov/misfortune.svg?token=AD3EhNWtTQ9MCngyujGy&branch=master)](https://travis-ci.com/nbekirov/misfortune)
2
+ [![Build Status](https://travis-ci.org/nbekirov/misfortune.svg?branch=master)](https://travis-ci.org/nbekirov/misfortune)
3
+ [![Code Climate](https://codeclimate.com/github/nbekirov/misfortune/badges/gpa.svg)](https://codeclimate.com/github/nbekirov/misfortune)
4
+ [![Dependency Status](https://gemnasium.com/badges/github.com/nbekirov/misfortune.svg)](https://gemnasium.com/github.com/nbekirov/misfortune)
3
5
 
4
6
  # Misfortune
5
7
 
@@ -0,0 +1,6 @@
1
+ class String
2
+ def strip_heredoc
3
+ # https://github.com/rails/rails/blob/7f18ea14c893cb5c9f04d4fda9661126758332b5/activesupport/lib/active_support/core_ext/string/strip.rb
4
+ gsub(/^#{scan(/^[ \t]*(?=\S)/).min}/, ''.freeze)
5
+ end
6
+ end
@@ -1,6 +1,8 @@
1
1
  require 'redcarpet'
2
2
  require 'redcarpet/render_strip'
3
3
 
4
+ require 'core_ext/string/strip'
5
+
4
6
  require 'misfortune/version'
5
7
  require 'misfortune/render/terminal'
6
8
  require 'misfortune/cookie_jar'
@@ -0,0 +1,23 @@
1
+ module Misfortune
2
+ module CLI
3
+ class CreditsCommand
4
+ attr_reader :options
5
+
6
+ def initialize(options)
7
+ @options = options
8
+ end
9
+
10
+ def run
11
+ puts <<-EOF.strip_heredoc
12
+ Original essay: unmaintainable code (http://mindprod.com/jgloss/unmain.html) by Roedy Green
13
+ EOF
14
+ puts <<-EOF.strip_heredoc
15
+ Markdown adaptation: How To Write Unmaintainable Code (https://github.com/Droogans/unmaintainable-code) by Andrew Yurisich
16
+ EOF
17
+ puts <<-EOF.strip_heredoc
18
+ Source code: misfortune (https://github.com/nbekirov/misfortune) by Nikolay Bekirov
19
+ EOF
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,6 +1,7 @@
1
1
  require 'thor'
2
2
  require 'misfortune/cli/random_command'
3
3
  require 'misfortune/cli/binge_command'
4
+ require 'misfortune/cli/credits_command'
4
5
 
5
6
  module Misfortune
6
7
  module CLI
@@ -28,6 +29,12 @@ module Misfortune
28
29
  def binge
29
30
  BingeCommand.new(options).run
30
31
  end
32
+
33
+ desc 'credits', 'Credits'
34
+
35
+ def credits
36
+ CreditsCommand.new(options).run
37
+ end
31
38
  end
32
39
  end
33
40
  end
@@ -1,3 +1,3 @@
1
1
  module Misfortune
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
@@ -9,15 +9,13 @@ Gem::Specification.new do |spec|
9
9
  spec.date = '2016-03-24'
10
10
  spec.summary = '"Unmaintainable code" turned into fortune cookies'
11
11
  spec.description = <<-EOF
12
- This gem is inspired by the fortune program found on many Unix-like systems.
12
+ This gem is a spin-off of the fortune program found on many Unix-like systems.
13
13
  It is bundled with quotations from the "Unmaintainable code" essay by Roedy Green.
14
-
15
- You can find the original work here: http://mindprod.com/jgloss/unmain.html
16
14
  EOF
17
15
 
18
16
  spec.authors = ['Nikolay Bekirov']
19
17
  spec.email = 'nbekirov@gmail.com'
20
- spec.homepage = 'http://rubygems.org/gems/misfortune'
18
+ spec.homepage = 'https://github.com/nbekirov/misfortune'
21
19
  spec.license = 'MIT'
22
20
  spec.required_ruby_version = '>= 2.0.0'
23
21
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: misfortune
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikolay Bekirov
@@ -109,23 +109,24 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.3'
111
111
  description: |2
112
- This gem is inspired by the fortune program found on many Unix-like systems.
112
+ This gem is a spin-off of the fortune program found on many Unix-like systems.
113
113
  It is bundled with quotations from the "Unmaintainable code" essay by Roedy Green.
114
-
115
- You can find the original work here: http://mindprod.com/jgloss/unmain.html
116
114
  email: nbekirov@gmail.com
117
115
  executables:
118
116
  - misfortune
119
117
  extensions: []
120
118
  extra_rdoc_files: []
121
119
  files:
120
+ - ".codeclimate.yml"
122
121
  - Gemfile
123
122
  - README.md
124
123
  - bin/misfortune
125
124
  - bin/setup
126
125
  - data/source.md
126
+ - lib/core_ext/string/strip.rb
127
127
  - lib/misfortune.rb
128
128
  - lib/misfortune/cli/binge_command.rb
129
+ - lib/misfortune/cli/credits_command.rb
129
130
  - lib/misfortune/cli/random_command.rb
130
131
  - lib/misfortune/cli/runner.rb
131
132
  - lib/misfortune/cookie_jar.rb
@@ -133,7 +134,7 @@ files:
133
134
  - lib/misfortune/render/terminal.rb
134
135
  - lib/misfortune/version.rb
135
136
  - misfortune.gemspec
136
- homepage: http://rubygems.org/gems/misfortune
137
+ homepage: https://github.com/nbekirov/misfortune
137
138
  licenses:
138
139
  - MIT
139
140
  metadata: {}