Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code improvements #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'

# Specify your gem's dependencies in statement.gemspec
Expand Down
6 changes: 4 additions & 2 deletions Rakefile
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env rake
# frozen_string_literal: true

require 'bundler'
require "bundler/gem_tasks"
require 'bundler/gem_tasks'
Bundler::GemHelper.install_tasks

require 'rake/testtask'
Expand All @@ -10,4 +12,4 @@ Rake::TestTask.new(:test) do |test|
test.verbose = true
end

task :default => :test
task default: :test
44 changes: 22 additions & 22 deletions benchmark/rfeedfinder_benchmark.rb
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
require "benchmark"
require "rubygems"
# frozen_string_literal: true

require 'benchmark'
require 'rubygems'

sites = [
"log.damog.net",
"http://cnn.com",
"scripting.com",
"mx.planetalinux.org",
"http://feedproxy.google.com/UniversoPlanetaLinux",
'log.damog.net',
'http://cnn.com',
'scripting.com',
'mx.planetalinux.org',
'http://feedproxy.google.com/UniversoPlanetaLinux'
]

Benchmark.bm do |x|
sites.each do |site|
puts "#{site}:"

puts " feedbag"
x.report {
require 'feedbag'
Feedbag.find(site)
}
sites.each do |site|
puts "#{site}:"

puts " rfeedfinder"
x.report {
require 'rfeedfinder'
Rfeedfinder.feed(site)
}
puts ' feedbag'
x.report do
require 'feedbag'
Feedbag.find(site)
end

end
puts ' rfeedfinder'
x.report do
require 'rfeedfinder'
Rfeedfinder.feed(site)
end
end
end

8 changes: 4 additions & 4 deletions bin/console
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"
require "feedbag"
require "byebug"
require 'bundler/setup'
require 'feedbag'
require 'byebug'
# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.

# (If you use this, don't forget to add pry to your Gemfile!)
# require "pry"
# Pry.start

require "irb"
require 'irb'
IRB.start(__FILE__)
14 changes: 7 additions & 7 deletions bin/feedbag
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require "rubygems"
require "feedbag"
require 'rubygems'
require 'feedbag'

def usage
%Q{
#{$0} <url 1> [<url 2> <url 3> ... <url n>]
}
%(
#{$PROGRAM_NAME} <url 1> [<url 2> <url 3> ... <url n>]
)
end

if ARGV.empty?
Expand All @@ -18,11 +19,10 @@ ARGV.each do |url|
puts "== #{url}:"
feeds = Feedbag.find url
if feeds.empty?
puts " no feeds found!"
puts ' no feeds found!'
else
feeds.each do |f|
puts " - #{f}"
end
end
end

32 changes: 16 additions & 16 deletions feedbag.gemspec
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# -*- encoding: utf-8 -*-
# frozen_string_literal: true

require_relative "lib/feedbag"
require_relative 'lib/feedbag'

Gem::Specification.new do |s|
s.name = %q{feedbag}
s.name = 'feedbag'
s.version = Feedbag::VERSION
s.homepage = "http://github.com/damog/feedbag"
s.licenses = ["MIT"]
s.authors = ["David Moreno"]
s.description = %q{Ruby's favorite feed auto-discovery tool}
s.email = %q{[email protected]}
s.homepage = 'http://github.com/damog/feedbag'
s.licenses = ['MIT']
s.authors = ['David Moreno']
s.description = "Ruby's favorite feed auto-discovery tool"
s.email = '[email protected]'

s.extra_rdoc_files = ["README.markdown", "COPYING"]
s.files = ["lib/feedbag.rb", "benchmark/rfeedfinder_benchmark.rb", "bin/feedbag"]
s.extra_rdoc_files = ['README.markdown', 'COPYING']
s.files = ['lib/feedbag.rb', 'benchmark/rfeedfinder_benchmark.rb', 'bin/feedbag']
# s.has_rdoc = true
s.rdoc_options = ["--main", "README.markdown"]
s.summary = %q{RSS/Atom feed auto-discovery tool}
s.rdoc_options = ['--main', 'README.markdown']
s.summary = 'RSS/Atom feed auto-discovery tool'

s.add_runtime_dependency 'nokogiri', '~> 1.8', '>= 1.8.2'

s.add_development_dependency 'shoulda', '~> 3'
s.add_development_dependency 'mocha', '~> 0.12', '>= 0.12.0'
s.add_development_dependency 'webmock', '~> 3'
s.add_development_dependency 'byebug', '~> 11'
s.add_development_dependency 'mocha', '~> 0.12', '>= 0.12.0'
s.add_development_dependency 'rake', '~> 12'
s.add_development_dependency 'shoulda', '~> 3'
s.add_development_dependency 'test-unit', '~> 3'
s.add_development_dependency 'webmock', '~> 3'

s.bindir = 'bin'
s.executables = ["feedbag"]
s.executables = ['feedbag']
end
Loading