Class: HeyDan::HelpText
- Inherits:
-
Object
- Object
- HeyDan::HelpText
- Defined in:
- lib/heydan/help_text.rb
Class Method Summary collapse
- .build(opts = {}) ⇒ Object
- .build_identifier(identifier) ⇒ Object
- .git_clone(name) ⇒ Object
- .git_update(name) ⇒ Object
- .import ⇒ Object
- .setup(opts = {}) ⇒ Object
- .sources_add ⇒ Object
- .sources_build ⇒ Object
- .sources_new ⇒ Object
- .sources_sync ⇒ Object
- .sources_update ⇒ Object
Class Method Details
.build(opts = {}) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/heydan/help_text.rb', line 20 def build(opts={}) return if !HeyDan.help? type = opts[:type] || 'all' puts %Q( Woot, building files for type #{type} jurisdictions/. You will see a progress bar below. If you didn't specify a type, it might take a while. heydan uses the Open Civic Identifiers format to structure file names and main identification for jurisdictions. This helps create a unique nonchanging identification code for every jurisdiction, based on the sponsoring parent. So, the State of Kansas, would be country:us/state:kansas. heydan creates a flat json file for each jurisdiction, which you can then import into your own application or elasticsearch. Next, run heydan sources sync ) end |
.build_identifier(identifier) ⇒ Object
71 72 73 74 |
# File 'lib/heydan/help_text.rb', line 71 def build_identifier(identifier) return if !HeyDan.help? puts %Q("building identifiers hash for #{identifier} to filenames, this might take a moment") end |
.git_clone(name) ⇒ Object
61 62 63 64 |
# File 'lib/heydan/help_text.rb', line 61 def git_clone(name) return if !HeyDan.help? puts %Q(Cloning #{name} into #{HeyDan.folders[:sources]}) end |
.git_update(name) ⇒ Object
66 67 68 69 |
# File 'lib/heydan/help_text.rb', line 66 def git_update(name) return if !HeyDan.help? puts %Q(Updating #{name} in #{HeyDan.folders[:sources]}) end |
.import ⇒ Object
76 77 78 79 |
# File 'lib/heydan/help_text.rb', line 76 def import return if !HeyDan.help? puts "This will import all the files/contents from the jurisdictions folder into ElasticSearch. Make sure it's running!" end |
.setup(opts = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/heydan/help_text.rb', line 3 def setup(opts={}) return if !HeyDan.help? puts %Q( Hi! Adding a jurisdictions, datasets, downloads and sources directory and a settings.yml file. If you want to move these directories to other places, just update their locations in the settings file. If you want to run heydan from a different folder than the settings.yml, create an environment variable: export HEYDAN_SETTINGS = full/path/to/settings.yml To turn off this help, run 'heydan help off' or set the help in settings to false. heydan grabs datasets and information about jurisdictions. If you want to focus on just one type of jurisdiction, update the settings 'jurisdiction_type'. Or you can pass --type school_district to any heydan command. Next, run `heydan build` to setup your files. ) end |
.sources_add ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/heydan/help_text.rb', line 32 def sources_add return if !HeyDan.help? puts %Q( You can leverage the community of developers out there. Add the github link to a source repo and tap into all that hardwork. When you add a new one, it will get stored in your settings file under 'sources' ) end |
.sources_build ⇒ Object
55 56 |
# File 'lib/heydan/help_text.rb', line 55 def sources_build end |
.sources_new ⇒ Object
58 59 |
# File 'lib/heydan/help_text.rb', line 58 def sources_new end |