Skip to content

Commit c553081

Browse files
committed
we want to renamespace to Onebox
1 parent 07890c4 commit c553081

14 files changed

+87
-120
lines changed

.ruby-gemset

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
oneboxer
1+
onebox

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
source 'https://rubygems.org'
22

3-
# Specify your gem's dependencies in discourse-oneboxer.gemspec
3+
# Specify your gem's dependencies in discourse-onebox.gemspec
44
gemspec

README.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
discourse-oneboxer
1+
discourse-onebox
22
----------
33

44
- TODO: register to rubygems.org
5-
- [![Code Climate](https://codeclimate.com/github/dysania/discourse-oneboxer.png)](https://codeclimate.com/github/dysania/discourse-oneboxer)
6-
- [![Build Status](https://travis-ci.org/dysania/discourse-oneboxer.png)](https://travis-ci.org/dysania/discourse-oneboxer)
7-
- [![Dependency Status](https://gemnasium.com/dysania/discourse-oneboxer.png)](https://gemnasium.com/dysania/discourse-oneboxer)
8-
- [![Coverage Status](https://coveralls.io/repos/dysania/discourse-oneboxer/badge.png)](https://coveralls.io/r/dysania/discourse-oneboxer)
5+
- [![Code Climate](https://codeclimate.com/github/dysania/discourse-onebox.png)](https://codeclimate.com/github/dysania/discourse-onebox)
6+
- [![Build Status](https://travis-ci.org/dysania/discourse-onebox.png)](https://travis-ci.org/dysania/discourse-onebox)
7+
- [![Dependency Status](https://gemnasium.com/dysania/discourse-onebox.png)](https://gemnasium.com/dysania/discourse-onebox)
8+
- [![Coverage Status](https://coveralls.io/repos/dysania/discourse-onebox/badge.png)](https://coveralls.io/r/dysania/discourse-onebox)
99

1010

11-
Oneboxer is a library for turning media URLs into previews.
11+
Onebox is a library for turning media URLs into previews.
1212

13-
Oneboxer currently has support for page, image, and video URLs from these sites:
13+
Onebox currently has support for page, image, and video URLs from these sites:
1414
- Amazon
1515
- Android App Store
1616
- Apple Store
@@ -44,13 +44,13 @@ Oneboxer currently has support for page, image, and video URLs from these sites:
4444
- yFrog
4545

4646

47-
Using discourse-oneboxer
47+
Using discourse-onebox
4848
===============
4949

50-
You can include discourse-oneboxer modules into a class like so:
50+
You can include discourse-onebox modules into a class like so:
5151

5252
``` ruby
53-
require "discourse-oneboxer"
53+
require "discourse-onebox"
5454
```
5555
TODO: write example
5656

@@ -62,24 +62,24 @@ The `Gemfile` file would look like this:
6262
# source/Gemfile
6363
source "https://rubygems.org"
6464

65-
gem "discourse-oneboxer", "~> <%= version %>"
65+
gem "discourse-onebox", "~> <%= version %>"
6666
```
6767

6868

69-
Installing discourse-oneboxer
69+
Installing discourse-onebox
7070
==================
7171

7272
Add this line to your application's Gemfile:
7373

74-
gem 'discourse-oneboxer'
74+
gem 'discourse-onebox'
7575

7676
And then execute:
7777

7878
$ bundle
7979

8080
Or install it yourself as:
8181

82-
$ gem install discourse-oneboxer
82+
$ gem install discourse-onebox
8383

8484

8585
Contributing

lib/oneboxer/preview.rb lib/onebox/preview.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require_relative "preview/amazon"
33

44

5-
module Oneboxer
5+
module Onebox
66
class Preview
77
def initialize(link)
88
@url = link

lib/oneboxer/preview/amazon.rb lib/onebox/preview/amazon.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Oneboxer
1+
module Onebox
22
class Preview
33
class Amazon
44
TEMPLATE = File.read(File.join("templates", "amazon.handlebars"))

lib/oneboxer/preview/example.rb lib/onebox/preview/example.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Oneboxer
1+
module Onebox
22
class Preview
33
class Example
44
TEMPLATE = %|<div class="onebox">{{{header}}}</div>|
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module Oneboxer
1+
module Onebox
22
VERSION = "1.0.0"
33
end

lib/oneboxer.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
require "nokogiri"
44
require "mustache"
55

6-
require_relative "oneboxer/version"
7-
require_relative "oneboxer/preview"
6+
require_relative "onebox/version"
7+
require_relative "onebox/preview"
88

99

10-
module Oneboxer
10+
module Onebox
1111
def self.preview(url, args={})
1212
Preview.new(url, args)
1313
end

oneboxer.gemspec onebox.gemspec

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# coding: utf-8
22
lib = File.expand_path('../lib', __FILE__)
33
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4-
require 'oneboxer/version'
4+
require 'onebox/version'
55

66
Gem::Specification.new do |spec|
7-
spec.name = "oneboxer"
8-
spec.version = Oneboxer::VERSION
7+
spec.name = "onebox"
8+
spec.version = Onebox::VERSION
99
spec.authors = ["Joanna Zeta", "Vyki Englert"]
1010
1111
spec.description = %q{A gem for turning URLs into previews.}
1212
spec.summary = spec.description
13-
spec.homepage = "http://github.com/dysania/discourse-oneboxer"
13+
spec.homepage = "http://github.com/dysania/discourse-onebox"
1414
spec.license = "MIT"
1515

1616
spec.files = `git ls-files`.split($/)

spec/fixtures/github_pullrequest.response

+56-56
Large diffs are not rendered by default.

spec/lib/preview/amazon_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require "spec_helper"
22

3-
describe Oneboxer::Preview::Amazon do
3+
describe Onebox::Preview::Amazon do
44
describe "#to_html" do
55
let(:link) { "http://example.com" }
66

spec/lib/preview/example_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require "spec_helper"
22

3-
describe Oneboxer::Preview::Example do
3+
describe Onebox::Preview::Example do
44
describe "#to_html" do
55
it "returns template if given valid data" do
66
example = described_class.new(response("example.response"), "http://www.example.com")

spec/lib/preview_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require "spec_helper"
22

3-
describe Oneboxer::Preview do
3+
describe Onebox::Preview do
44
describe "#to_s" do
55
it "returns some html if given a valid url" do
66
fake("http://www.example.com", response("example.response"))

spec/spec_helper.rb

+1-34
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,8 @@
66
require "rspec"
77
require "pry"
88
require "fakeweb"
9-
require "oneboxer"
10-
require "nokogiri/xml/parse_options"
9+
require "onebox"
1110
require 'mocha/api'
1211

1312
require_relative "support/html_spec_helper"
1413

15-
module SpecHelper
16-
def fixture_file(path)
17-
File.read(File.join("spec", "fixtures", path))
18-
end
19-
end
20-
21-
RSpec.configure do |config|
22-
config.include SpecHelper
23-
config.include HTMLSpecHelper
24-
end
25-
26-
RSpec::Matchers.define :match_html do |expected|
27-
match do |actual|
28-
a = make_canonical_html(expected).to_html.gsub("\r\n", "\n")
29-
b = make_canonical_html(actual).to_html.gsub("\r\n", "\n")
30-
a == b
31-
end
32-
33-
failure_message_for_should do |actual|
34-
"after sanitizing for extra white space and compactness, expected:\n#{actual.gsub("\r\n", "\n").inspect}\n to match:\n#{expected.gsub("\r\n", "\n").inspect}"
35-
end
36-
37-
failure_message_for_should_not do |actual|
38-
"after sanitizing for extra white space and compactness, expected:\n#{actual}\n not to match:\n#{expected}"
39-
end
40-
41-
def make_canonical_html(html)
42-
Nokogiri::HTML(html) do |config|
43-
config.options = Nokogiri::XML::ParseOptions::NOBLANKS | Nokogiri::XML::ParseOptions::COMPACT
44-
end
45-
end
46-
end

0 commit comments

Comments
 (0)