Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read log files and produce output #2

Merged
merged 13 commits into from
Apr 7, 2016
Merged

Conversation

jmartin-sul
Copy link
Member

This is the meat of the script. (Still TBD: rake task to run it, cap deployment)

paired with @ndushay (and I survived [ed note: @ndushay wrote that])

connects to sul-dlss/media#7

ndushay and others added 8 commits April 5, 2016 15:26
…hod being tested

* rwj_reporter_spec.rb: get rid of placeholder test, expect real output, move to spec/lib/rwj_reporter_spec to mirror code living in lib
* rwj_reporter.rb: implement RwjReporter.get_show_numbers_from_log_file, make it a static method, add explanatory comment
* add test fixture
…_date_range

* test for date range that includes leap day
* implementation could use refactoring and comments
* add fixtures
@jmartin-sul
Copy link
Member Author

@tingulfsen @jkeck one of you want to moige this baby?

@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.674% when pulling f88c819 on read-single-log-file into 2f10aec on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.727% when pulling 8e68cfe on read-single-log-file into 2f10aec on master.

@jmartin-sul
Copy link
Member Author

@ndushay: one more commit, for rubocop stuff: 8e68cfe

hopefully all uncontroversial. increased the line length to 140, rather than lengthen lines further with specific rubocop exceptions, or blanket excepting the two files that actually matter in this code.

end

def self.get_log_file_dir_from_settings
def self.log_file_dir_from_settings
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't know why this is the only get_ method that rubocop complained about, and why i thought of this as an "accessor" method but not the others.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.727% when pulling f71e1b2 on read-single-log-file into 2f10aec on master.


def channel_counts(start_date_str, end_date_str)
@start_date_str = start_date_str
@end_date_str = end_date_str
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This use of instance variables to set state feels odd to me. It implies that file_name cannot be called until after channel_counts since that sets the state.

I don't know that I have a solid suggestion, but maybe make methods that depend on this state being set private since we don't want somebody inadvertently calling it from the outside w/o realizing the need to invoke the channel_counts method first.

Also
 use a constant for fixture directory
 make file_name private
@coveralls
Copy link

Coverage Status

Coverage remained the same at 98.148% when pulling e1912faccfa274cefb41518a5b4d62b50110d147 on read-single-log-file into 2f10aec on master.

…thods can be considered private

reorganize spec file
@ndushay
Copy link
Contributor

ndushay commented Apr 6, 2016

@jkeck @tingulfsen

added output directory to configurable settings; refactored per Jessie's suggestions so class methods aren't depending on order of execution of instance methods, and made a lot more methods private.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 98.148% when pulling de1895a on read-single-log-file into 2f10aec on master.

@jkeck
Copy link
Contributor

jkeck commented Apr 6, 2016

Looks relatively good to me for a shameless green. @ndushay added some comments to appease me.

@tingulfsen ready for your expert 👀.

This was referenced Apr 7, 2016
@tingulfsen tingulfsen merged commit 310d1ec into master Apr 7, 2016
@tingulfsen tingulfsen deleted the read-single-log-file branch April 7, 2016 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants