From 72466b9f1c8ed4ebaa72e19e5f533bda7e25aa76 Mon Sep 17 00:00:00 2001 From: Rob Sears Date: Wed, 27 Apr 2016 16:39:27 -0600 Subject: [PATCH] Change Searchyou to Searchyll --- Gemfile | 2 +- README.md | 10 +++++----- bin/console | 2 +- lib/searchyll.rb | 6 ++++++ lib/{searchyou => searchyll}/configuration.rb | 2 +- lib/{searchyou => searchyll}/generator.rb | 8 ++++---- lib/{searchyou => searchyll}/indexer.rb | 2 +- lib/{searchyou => searchyll}/version.rb | 2 +- lib/searchyou.rb | 6 ------ searchyou.gemspec => searchyll.gemspec | 6 +++--- spec/{searchyou => searchyll}/generator_spec.rb | 6 +++--- spec/{searchyou => searchyll}/indexer_spec.rb | 4 ++-- spec/searchyll_spec.rb | 9 +++++++++ spec/searchyou_spec.rb | 9 --------- spec/spec_helper.rb | 2 +- 15 files changed, 38 insertions(+), 38 deletions(-) create mode 100644 lib/searchyll.rb rename lib/{searchyou => searchyll}/configuration.rb (98%) rename lib/{searchyou => searchyll}/generator.rb (86%) rename lib/{searchyou => searchyll}/indexer.rb (99%) rename lib/{searchyou => searchyll}/version.rb (58%) delete mode 100644 lib/searchyou.rb rename searchyou.gemspec => searchyll.gemspec (90%) rename spec/{searchyou => searchyll}/generator_spec.rb (73%) rename spec/{searchyou => searchyll}/indexer_spec.rb (58%) create mode 100644 spec/searchyll_spec.rb delete mode 100644 spec/searchyou_spec.rb diff --git a/Gemfile b/Gemfile index cc91c2a..4b07c30 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ source 'https://rubygems.org' -# Specify your gem's dependencies in searchyou.gemspec +# Specify your gem's dependencies in searchyll.gemspec gemspec diff --git a/README.md b/README.md index 0595dab..7611847 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Searchyou +# Searchyll -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/searchyou`. To experiment with that code, run `bin/console` for an interactive prompt. +Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/searchyll`. To experiment with that code, run `bin/console` for an interactive prompt. TODO: Delete this and the text above, and describe your gem @@ -9,7 +9,7 @@ TODO: Delete this and the text above, and describe your gem Add this line to your application's Gemfile: ```ruby -gem 'searchyou' +gem 'searchyll' ``` And then execute: @@ -18,7 +18,7 @@ And then execute: Or install it yourself as: - $ gem install searchyou + $ gem install searchyll ## Usage @@ -41,4 +41,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/searchyou. +Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/searchyll. diff --git a/bin/console b/bin/console index 9fc7edd..445cd01 100755 --- a/bin/console +++ b/bin/console @@ -1,7 +1,7 @@ #!/usr/bin/env ruby require "bundler/setup" -require "searchyou" +require "searchyll" # 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. diff --git a/lib/searchyll.rb b/lib/searchyll.rb new file mode 100644 index 0000000..ae1db2c --- /dev/null +++ b/lib/searchyll.rb @@ -0,0 +1,6 @@ +require "searchyll/version" + +require "jekyll/plugin" +require "jekyll/generator" + +require "searchyll/generator" diff --git a/lib/searchyou/configuration.rb b/lib/searchyll/configuration.rb similarity index 98% rename from lib/searchyou/configuration.rb rename to lib/searchyll/configuration.rb index 01c98b7..6a6e4a7 100644 --- a/lib/searchyou/configuration.rb +++ b/lib/searchyll/configuration.rb @@ -1,4 +1,4 @@ -module Searchyou +module Searchyll class Configuration attr_accessor :site def initialize(site) diff --git a/lib/searchyou/generator.rb b/lib/searchyll/generator.rb similarity index 86% rename from lib/searchyou/generator.rb rename to lib/searchyll/generator.rb index c4154c8..25f5d75 100644 --- a/lib/searchyou/generator.rb +++ b/lib/searchyll/generator.rb @@ -1,7 +1,7 @@ -require 'searchyou/indexer' -require 'searchyou/configuration' +require 'searchyll/indexer' +require 'searchyll/configuration' -module Searchyou +module Searchyll class Generator < Jekyll::Generator @@ -15,7 +15,7 @@ def generate(site) configuration = Configuration.new(site) # Prepare the indexer - indexer = Searchyou::Indexer.new(configuration) + indexer = Searchyll::Indexer.new(configuration) indexer.start # Iterate through the site contents and send to indexer diff --git a/lib/searchyou/indexer.rb b/lib/searchyll/indexer.rb similarity index 99% rename from lib/searchyou/indexer.rb rename to lib/searchyll/indexer.rb index ed1086c..ea35253 100644 --- a/lib/searchyou/indexer.rb +++ b/lib/searchyll/indexer.rb @@ -1,7 +1,7 @@ require 'json' require 'net/http' -module Searchyou +module Searchyll class Indexer BATCH_SIZE = 50 diff --git a/lib/searchyou/version.rb b/lib/searchyll/version.rb similarity index 58% rename from lib/searchyou/version.rb rename to lib/searchyll/version.rb index 316d923..374d44b 100644 --- a/lib/searchyou/version.rb +++ b/lib/searchyll/version.rb @@ -1,3 +1,3 @@ -module Searchyou +module Searchyll VERSION = "0.1.0" end diff --git a/lib/searchyou.rb b/lib/searchyou.rb deleted file mode 100644 index 37ecb3e..0000000 --- a/lib/searchyou.rb +++ /dev/null @@ -1,6 +0,0 @@ -require "searchyou/version" - -require "jekyll/plugin" -require "jekyll/generator" - -require "searchyou/generator" diff --git a/searchyou.gemspec b/searchyll.gemspec similarity index 90% rename from searchyou.gemspec rename to searchyll.gemspec index d32823f..69cbad5 100644 --- a/searchyou.gemspec +++ b/searchyll.gemspec @@ -1,11 +1,11 @@ # coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'searchyou/version' +require 'searchyll/version' Gem::Specification.new do |spec| - spec.name = "searchyou" - spec.version = Searchyou::VERSION + spec.name = "searchyll" + spec.version = Searchyll::VERSION spec.authors = ["Nick Zadrozny"] spec.email = ["nick@beyondthepath.com"] diff --git a/spec/searchyou/generator_spec.rb b/spec/searchyll/generator_spec.rb similarity index 73% rename from spec/searchyou/generator_spec.rb rename to spec/searchyll/generator_spec.rb index 6f6d064..3a89845 100644 --- a/spec/searchyou/generator_spec.rb +++ b/spec/searchyll/generator_spec.rb @@ -1,9 +1,9 @@ require File.expand_path('../spec_helper', File.dirname(__FILE__)) -describe Searchyou::Generator do +describe Searchyll::Generator do it 'is a Jekyll Generator' do - expect(Searchyou::Generator.new).to be_a(Jekyll::Generator) + expect(Searchyll::Generator.new).to be_a(Jekyll::Generator) end let(:jekyll_site) do @@ -15,7 +15,7 @@ # TODO: integrated site generation it 'can generate an index' do - g = Searchyou::Generator.new + g = Searchyll::Generator.new g.generate(jekyll_site) end diff --git a/spec/searchyou/indexer_spec.rb b/spec/searchyll/indexer_spec.rb similarity index 58% rename from spec/searchyou/indexer_spec.rb rename to spec/searchyll/indexer_spec.rb index c5365f2..50887b4 100644 --- a/spec/searchyou/indexer_spec.rb +++ b/spec/searchyll/indexer_spec.rb @@ -1,9 +1,9 @@ require File.expand_path('../spec_helper', File.dirname(__FILE__)) -describe Searchyou::Indexer do +describe Searchyll::Indexer do it 'is instantiated with an Elasticsearch URL' do - expect { Searchyou::Indexer.new }.to raise_error(ArgumentError) + expect { Searchyll::Indexer.new }.to raise_error(ArgumentError) end end diff --git a/spec/searchyll_spec.rb b/spec/searchyll_spec.rb new file mode 100644 index 0000000..6175fd0 --- /dev/null +++ b/spec/searchyll_spec.rb @@ -0,0 +1,9 @@ +require 'spec_helper' + +describe Searchyll do + + it 'has a version number' do + expect(Searchyll::VERSION).not_to be nil + end + +end diff --git a/spec/searchyou_spec.rb b/spec/searchyou_spec.rb deleted file mode 100644 index 75a7978..0000000 --- a/spec/searchyou_spec.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'spec_helper' - -describe Searchyou do - - it 'has a version number' do - expect(Searchyou::VERSION).not_to be nil - end - -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 3885760..c40eff1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,2 +1,2 @@ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) -require 'searchyou' +require 'searchyll'