-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from kenchiki/development
3.5.0に対応
- Loading branch information
Showing
8 changed files
with
39 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,14 @@ | ||
require "mastodon_command/version" | ||
require "mastodon_command/convert" | ||
require "mastodon_command/convert_random" | ||
require "mastodon_command/convert_lang" | ||
require "mastodon_command/statuses_controller_patch" | ||
require 'mastodon_command/version' | ||
require 'mastodon_command/converter' | ||
require 'mastodon_command/random_converter' | ||
require 'mastodon_command/lang_converter' | ||
require 'mastodon_command/statuses_controller_patch' | ||
|
||
module MastodonCommand | ||
def self.setup(&proc) | ||
# create function for Monkey patch | ||
extend self | ||
( | ||
class << self; | ||
self | ||
end).module_eval do | ||
define_method 'convert_toot', &proc | ||
# define_method 'b' do | ||
# p 'b' | ||
# end | ||
end | ||
define_singleton_method(:convert_toot, &proc) | ||
|
||
# Monkey patch | ||
Api::V1::StatusesController.prepend(MastodonCommand::StatusesControllerPatch) | ||
end | ||
end | ||
|
This file was deleted.
Oops, something went wrong.
5 changes: 2 additions & 3 deletions
5
lib/mastodon_command/convert.rb → lib/mastodon_command/converter.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
lib/mastodon_command/convert_lang.rb → lib/mastodon_command/lang_converter.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module MastodonCommand | ||
class RandomConverter < MastodonCommand::Converter | ||
def convert(input) | ||
"#{input}\nあなたの運勢は「#{@replaces.sample}」です" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module MastodonCommand | ||
VERSION = "0.1.9" | ||
VERSION = '0.1.10'.freeze | ||
end |