Skip to content

Commit a19eddc

Browse files
author
Aditia Mahdar Ganteng
committed
Initial commit
1 parent ab42dd5 commit a19eddc

File tree

4 files changed

+31
-5
lines changed

4 files changed

+31
-5
lines changed

Rakefile

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
require "bundler/gem_tasks"
2+
Dir.glob('tasks/**/*.rake').each(&method(:import))

lib/pageinfo.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
require "pageinfo/version"
22

33
module Pageinfo
4-
# Your code goes here...
4+
def self.process(str)
5+
# TODO: process `str`
6+
str
7+
end
58
end

pageinfo.gemspec

+5-4
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ require 'pageinfo/version'
66
Gem::Specification.new do |spec|
77
spec.name = "pageinfo"
88
spec.version = Pageinfo::VERSION
9-
spec.authors = ["Aditia Mahdar Ganteng"]
9+
spec.authors = ["aditiamahdar"]
1010
spec.email = ["[email protected]"]
1111

12-
spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.}
13-
spec.description = %q{TODO: Write a longer description or delete this line.}
14-
spec.homepage = "TODO: Put your gem's website or public repo URL here."
12+
spec.summary = %q{Browse your page meta info and optimize your SEO strategy.}
13+
spec.description = %q{pageinfo will browse through your site then list every page on your site and give detail meta info about the page.}
14+
# spec.homepage = "#"
1515
spec.license = "MIT"
1616

1717
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -25,4 +25,5 @@ Gem::Specification.new do |spec|
2525

2626
spec.add_development_dependency "bundler", "~> 1.9"
2727
spec.add_development_dependency "rake", "~> 10.0"
28+
spec.add_development_dependency "rspec"
2829
end

spec/pageinfo_spec.rb

+21
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,25 @@
88
it 'does something useful' do
99
expect(false).to eq(true)
1010
end
11+
12+
subject { Pageinfo.new }
13+
14+
describe "#process" do
15+
let(:input) { "My grandmom gave me a sweater for Christmas." }
16+
let(:output) { subject.process(input) }
17+
18+
it 'converts to lowercase' do
19+
expect(output.downcase).to eq output
20+
end
21+
22+
it 'combines nouns with doge adjectives' do
23+
expect(output).to match /so grandmom./i
24+
expect(output).to match /such sweater./i
25+
expect(output).to match /very christmas./i
26+
end
27+
28+
it 'always appends "wow."' do
29+
expect(output).to end_with 'wow.'
30+
end
31+
end
1132
end

0 commit comments

Comments
 (0)