Skip to content

Commit

Permalink
Refactor refinement
Browse files Browse the repository at this point in the history
  • Loading branch information
masutaka committed Mar 27, 2016
1 parent 11f5e80 commit ca8300f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions lib/github/nippou.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'github/nippou/concern/sawyer_resource_github'
require 'github/nippou/concern/string_markdown'

require 'github/nippou/commands'
require 'github/nippou/user_events'
Expand Down
10 changes: 1 addition & 9 deletions lib/github/nippou/commands.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
require 'thor'

module StringExMarkdown
refine String do
def markdown_escape
self.gsub(/([`<>])/, '\\\\\1')
end
end
end

module Github
module Nippou
class Commands < Thor
using SawyerResourceGithub
using StringExMarkdown
using StringMarkdown

default_task :list
class_option :since_date, type: :string,
Expand Down
7 changes: 7 additions & 0 deletions lib/github/nippou/concern/string_markdown.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module StringMarkdown
refine String do
def markdown_escape
self.gsub(/([`<>])/, '\\\\\1')
end
end
end

0 comments on commit ca8300f

Please sign in to comment.