diff --git a/Gemfile b/Gemfile index 5665fff..0daef45 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ source 'https://rubygems.org' -# Specify your gem's dependencies in libtcod.gemspec +# Specify your gem's dependencies in twitter_ebooks.gemspec gemspec diff --git a/lib/twitter_ebooks/model.rb b/lib/twitter_ebooks/model.rb index 5619c93..dd01834 100644 --- a/lib/twitter_ebooks/model.rb +++ b/lib/twitter_ebooks/model.rb @@ -47,7 +47,7 @@ module Ebooks lines.each do |l| next if l.start_with?('#') # Remove commented lines next if l.include?('RT') || l.include?('MT') # Remove soft retweets - + if l.include?('@') mentions << l else diff --git a/script/process_anc_data.rb b/script/process_anc_data.rb deleted file mode 100755 index bc1af60..0000000 --- a/script/process_anc_data.rb +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env ruby -# encoding: utf-8 - -require 'json' - -freqmap = {} - -data = File.read("data/ANC-all-count.txt") -data = data.unpack("C*").pack("U*") - -data.lines.each do |l| - vals = l.split("\t") - - freqmap[vals[0]] = vals[-1].to_i -end - -File.open("data/wordfreq.json", 'w') do |f| - f.write(JSON.dump(freqmap)) -end diff --git a/spec/data/0xabad1dea.model b/spec/data/0xabad1dea.model new file mode 100644 index 0000000..90a22ea Binary files /dev/null and b/spec/data/0xabad1dea.model differ diff --git a/spec/model_spec.rb b/spec/model_spec.rb new file mode 100644 index 0000000..d305b5f --- /dev/null +++ b/spec/model_spec.rb @@ -0,0 +1,8 @@ +require 'spec_helper' +require 'objspace' + +describe Ebooks::Model do + it "does stuff" do + model = Ebooks::Model.load(path("data/0xabad1dea.model")) + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..f365da0 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,5 @@ +require 'twitter_ebooks' + +def path(relpath) + File.join(File.dirname(__FILE__), relpath) +end diff --git a/twitter_ebooks.gemspec b/twitter_ebooks.gemspec index 678b8b9..1bdeb4e 100644 --- a/twitter_ebooks.gemspec +++ b/twitter_ebooks.gemspec @@ -15,7 +15,9 @@ Gem::Specification.new do |gem| gem.require_paths = ["lib"] gem.version = Ebooks::VERSION - gem.add_runtime_dependency 'minitest' + gem.add_development_dependency 'rspec' + gem.add_development_dependency 'memory_profiler' + gem.add_runtime_dependency 'twitter', '~> 4.5' gem.add_runtime_dependency 'tweetstream', '= 2.5'