lib/cinch/plugins/octospy/recording.rb in octospy-0.0.4 vs lib/cinch/plugins/octospy/recording.rb in octospy-0.0.5

- old
+ new

@@ -22,11 +22,11 @@ ::Octospy::Recordable.add_channel m.channel.name ::Octospy::Recordable.channel(m.channel.name).add_repo(repo) restart(m) - m.reply "I started to watch the #{repo} events" + m.reply "started to watch the #{repo} events" end def watch_repositories(m, owner) user = ::Octokit.user?(owner) @@ -41,27 +41,27 @@ ::Octospy::Recordable.channel(m.channel.name).add_repo(repo.full_name) repo.full_name } if repos.count > 0 - m.reply "I started to watch events of #{repos.count} repositories" + m.reply "started to watch events of #{repos.count} repositories" restart(m) end end def unwatch_repository(m, owner, project) repo = "#{owner}/#{project}" unless ::Octokit.repository?(repo) - m.reply "Sorry, '#{repo}' not found" + m.reply "sorry, '#{repo}' not found" return end ::Octospy::Recordable.channel(m.channel.name).remove_repo(repo) restart(m) - m.reply "I stopped to watch the #{repo} events" + m.reply "stopped to watch the #{repo} events" end def unwatch_repositories(m, owner) repos = ::Octospy::Recordable.channel(m.channel.name).repos.each_with_object([]) do |repo, obj| next unless repo.split('/').first == owner @@ -79,16 +79,17 @@ end end end def unwatch_all(m) + ::Octospy::Recordable.remove_channel(m.channel.name) end def show_watched_repositories(m) channel = ::Octospy::Recordable.channel(m.channel.name) if channel.nil? || channel.repos.nil? || channel.repos.empty? - m.reply 'nothing!' + m.reply 'nothing' return end channel.repos.each.with_index(1) do |repo, i| m.reply "#{i} #{repo}"