chimps_fb_analyzer 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,8 +2,12 @@
2
2
  require 'chimps_fb_analyzer'
3
3
 
4
4
  grab_output = false
5
+ directory = false
5
6
  path = ""
6
7
  options = {}
8
+
9
+ # TODO Handling incorrect arguments
10
+ # TODO Documentation and help
7
11
  ARGV.each do |arg|
8
12
  if grab_output
9
13
  grab_output = false
@@ -12,12 +16,26 @@ ARGV.each do |arg|
12
16
  case arg
13
17
  when "-o"
14
18
  grab_output = true
19
+ when "-d"
20
+ directory = true
15
21
  else
16
22
  path = arg
17
23
  end
18
24
  end
19
25
  end
20
26
 
21
- fb_anaylzer = ChimpsFBAnalyzer::FBAnalyzer.new(path)
22
- data = fb_anaylzer.analyze_wall
23
- fb_anaylzer.write_data_to_csv(data, options[:output_path])
27
+ if directory
28
+ Dir.foreach(path) do |item|
29
+ next if item == '.' or item == '..'
30
+
31
+ filepath = File.join path, item
32
+ fb_anaylzer = ChimpsFBAnalyzer::FBAnalyzer.new(filepath)
33
+ data = fb_anaylzer.analyze_wall
34
+ fb_anaylzer.write_data_to_csv(data, nil)
35
+ end
36
+ else
37
+ fb_anaylzer = ChimpsFBAnalyzer::FBAnalyzer.new(path)
38
+ data = fb_anaylzer.analyze_wall
39
+ fb_anaylzer.write_data_to_csv(data, options[:output_path])
40
+
41
+ end
@@ -1,3 +1,3 @@
1
1
  module ChimpsFBAnalyzer
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chimps_fb_analyzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Villena
@@ -65,6 +65,8 @@ files:
65
65
  - LICENSE.txt
66
66
  - README.md
67
67
  - Rakefile
68
+ - Sam_Schock_2_stats.csv
69
+ - Sam_Schock_stats.csv
68
70
  - bin/chimps_fb_analyzer
69
71
  - chimps_fb_analyzer.gemspec
70
72
  - lib/chimps_fb_analyzer.rb
@@ -90,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
92
  version: '0'
91
93
  requirements: []
92
94
  rubyforge_project:
93
- rubygems_version: 2.0.3
95
+ rubygems_version: 2.2.1
94
96
  signing_key:
95
97
  specification_version: 4
96
98
  summary: Analyze facebook pages