[
  {
    "path": ".gitignore",
    "content": "#----------------------------------------------------------------------------\n# Ignore these files when commiting to a git repository.\n#\n# See http://help.github.com/ignore-files/ for more about ignoring files.\n#\n# The original version of this file is found here:\n# https://github.com/RailsApps/rails-composer/blob/master/files/gitignore.txt\n#\n# Corrections? Improvements? Create a GitHub issue:\n# http://github.com/RailsApps/rails-composer/issues\n#----------------------------------------------------------------------------\n\n# user files\n/mcs/*\n\n# github issue template files\n/.github\n\n\n# bundler state\n/.bundle\n/vendor/bundle/\n/vendor/ruby/\n\n# minimal Rails specific artifacts\ndb/*.sqlite3\n/db/*.sqlite3-journal\n/log/*\n/tmp/*\n\n\n# add /config/database.yml if it contains passwords\n# /config/database.yml\n\n# various artifacts\n**.war\n*.rbc\n*.sassc\n.redcar/\n.sass-cache\n/config/config.yml\n/coverage.data\n/coverage/\n/db/*.javadb/\n/db/*.sqlite3\n/doc/api/\n/doc/app/\n/doc/features.html\n/doc/specs.html\n/public/cache\n/public/stylesheets/compiled\n/public/system/*\n/spec/tmp/*\n/cache\n/capybara*\n/capybara-*.html\n/gems\n/specifications\nrerun.txt\npickle-email-*.html\n.zeus.sock\n\n# If you find yourself ignoring temporary files generated by your text editor\n# or operating system, you probably want to add a global ignore instead:\n#   git config --global core.excludesfile ~/.gitignore_global\n#\n# Here are some files you may want to ignore globally:\n\n# scm revert files\n**.orig\n\n# Mac finder artifacts\n.DS_Store\n\n# Netbeans project directory\n/nbproject/\n\n# RubyMine project files\n.idea\n\n# Textmate project files\n/*.tmproj\n\n# vim artifacts\n**.swp\n\n# Environment files that may contain sensitive data\n.env\n.powenv\n\n# tilde files are usually backup files from a text editor\n*~\n"
  },
  {
    "path": ".rspec",
    "content": "--require spec_helper\n--format Fuubar\n--color"
  },
  {
    "path": ".ruby-gemset",
    "content": "dspectrumgui\n"
  },
  {
    "path": ".ruby-version",
    "content": "ruby-2.5.5\n"
  },
  {
    "path": ".well-known/.placeholder",
    "content": "\n"
  },
  {
    "path": "COMM-LICENSE",
    "content": "MIT License\n\nCopyright (c) 2017 Très Acton\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "Gemfile",
    "content": "source 'https://rubygems.org'\n\n\n# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'\nruby '2.5.5' \ngem 'rails', '4.2.11.1'\n\n# gem 'letsencrypt_plugin' # free SSL\n\n# Use sqlite3 as the database for Active Record\n# Use SCSS for stylesheets\ngem 'sass-rails', '~> 5.0'\n# Use Uglifier as compressor for JavaScript assets\ngem 'uglifier', '>= 1.3.0'\n# Use CoffeeScript for .coffee assets and views\ngem 'coffee-rails', '~> 4.1.0'\n# See https://github.com/rails/execjs#readme for more supported runtimes\n# gem 'therubyracer', platforms: :ruby\n\n# Use jquery as the JavaScript library\ngem 'jquery-rails'\n# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks\ngem 'turbolinks'\ngem 'jquery-turbolinks'\n\n# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder\ngem 'jbuilder', '~> 2.0'\n# bundle exec rake doc:rails generates the API under doc/api.\ngem 'will_paginate'\ngem 'will_paginate-bootstrap' \n\ngem 'seed_dump'\n\ngem 'shareable'\n\n\n\n# Use ActiveModel has_secure_password\n# gem 'bcrypt', '~> 3.1.7'\n\n# Use Unicorn as the app server\n# gem 'unicorn'\n\n# Use Capistrano for deployment\n# gem 'capistrano-rails', group: :development\n\ngroup :development, :test do\n  # Call 'byebug' anywhere in the code to stop execution and get a debugger console\n  gem 'byebug'\n  gem 'rake-progressbar'\n\n  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring\n  gem 'spring'\n  gem 'rails_real_favicon'\n  gem 'pry'\n\nend\ngem \"administrate\"\n\ngem 'bootstrap-sass'\ngem 'devise'\ngem 'devise_invitable'\ngem 'haml-rails'\ngem 'high_voltage'\n# gem 'pg'\ngem 'simple_form'\ngem 'upmin-admin'\n\ngroup :development do\n  # Access an IRB console on exception pages or by using <%= console %> in views\n  gem 'web-console', '~> 2.0'\n  gem 'better_errors'\n  gem 'binding_of_caller', :platforms=>[:mri_21]\n  gem 'guard-bundler'\n  gem 'guard-rails'\n  gem 'html2haml'\n  gem 'quiet_assets'\n  gem 'rails_apps_pages'\n  gem 'rails_apps_testing'\n  gem 'rails_layout'\n  gem 'rb-fchange', :require=>false\n  gem 'rb-inotify', :require=>false\n  gem 'spring-commands-rspec'\nend\n\ngroup :development, :test do\n  gem \"sqlite3\", \"~> 1.3.6\"\n  gem 'factory_girl_rails'\n  gem 'faker'\n  gem 'rspec-rails'\n  gem 'shoulda'\n  gem 'rb-fsevent', :require => false #if RUBY_PLATFORM =~ /darwin/i\n  gem 'guard-rspec'\n  gem 'fuubar'\nend\n\ngroup :production do\n  #gem 'puma'\n  gem 'rails_12factor'\nend\n\ngroup :test do\n  gem 'capybara'\n  gem 'database_cleaner'\n  gem 'launchy'\n  gem 'selenium-webdriver'\nend\n\n"
  },
  {
    "path": "Guardfile",
    "content": "# A sample Guardfile\n# More info at https://github.com/guard/guard#readme\n\n## Uncomment and set this to only include directories you want to watch\n# directories %w(app lib config test spec features) \\\n#  .select{|d| Dir.exists?(d) ? d : UI.warning(\"Directory #{d} does not exist\")}\n\n## Note: if you are using the `directories` clause above and you are not\n## watching the project directory ('.'), then you will want to move\n## the Guardfile to a watched dir and symlink it back, e.g.\n#\n#  $ mkdir config\n#  $ mv Guardfile config/\n#  $ ln -s config/Guardfile .\n#\n# and, you'll have to watch \"config/Guardfile\" instead of \"Guardfile\"\n\n# Note: The cmd option is now required due to the increasing number of ways\n#       rspec may be run, below are examples of the most common uses.\n#  * bundler: 'bundle exec rspec'\n#  * bundler binstubs: 'bin/rspec'\n#  * spring: 'bin/rspec' (This will use spring if running and you have\n#                          installed the spring binstubs per the docs)\n#  * zeus: 'zeus rspec' (requires the server to be started separately)\n#  * 'just' rspec: 'rspec'\n\nguard :rspec, cmd: \"bundle exec rspec\" do\n  require \"guard/rspec/dsl\"\n  dsl = Guard::RSpec::Dsl.new(self)\n\n  # Feel free to open issues for suggestions and improvements\n\n  # RSpec files\n  rspec = dsl.rspec\n  watch(rspec.spec_helper) { rspec.spec_dir }\n  watch(rspec.spec_support) { rspec.spec_dir }\n  watch(rspec.spec_files)\n\n  # Ruby files\n  ruby = dsl.ruby\n  dsl.watch_spec_files_for(ruby.lib_files)\n\n  # Rails files\n  rails = dsl.rails(view_extensions: %w(erb haml slim))\n  dsl.watch_spec_files_for(rails.app_files)\n  dsl.watch_spec_files_for(rails.views)\n\n  watch(rails.controllers) do |m|\n    [\n      rspec.spec.(\"routing/#{m[1]}_routing\"),\n      rspec.spec.(\"controllers/#{m[1]}_controller\"),\n      rspec.spec.(\"acceptance/#{m[1]}\")\n    ]\n  end\n\n  # Rails config changes\n  watch(rails.spec_helper)     { rspec.spec_dir }\n  watch(rails.routes)          { \"#{rspec.spec_dir}/routing\" }\n  watch(rails.app_controller)  { \"#{rspec.spec_dir}/controllers\" }\n\n  # Capybara features specs\n  watch(rails.view_dirs)     { |m| rspec.spec.(\"features/#{m[1]}\") }\n  watch(rails.layouts)       { |m| rspec.spec.(\"features/#{m[1]}\") }\n\n  # Turnip features and steps\n  watch(%r{^spec/acceptance/(.+)\\.feature$})\n  watch(%r{^spec/acceptance/steps/(.+)_steps\\.rb$}) do |m|\n    Dir[File.join(\"**/#{m[1]}.feature\")][0] || \"spec/acceptance\"\n  end\nend\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n  A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate.  Many developers of free software are heartened and\nencouraged by the resulting cooperation.  However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n  The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community.  It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server.  Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n  An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals.  This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Remote Network Interaction; Use with the GNU General Public License.\n\n  Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software.  This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as published\n    by the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source.  For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code.  There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n<http://www.gnu.org/licenses/>.\n"
  },
  {
    "path": "README.md",
    "content": "# DSpectrumGUI\n\nThe goal of this app is to make it trivial to demodulate common RF signals, and provide a digital worksheet for your reverse engineering efforts.\n\n![DSpectrumGUI Screenshot](https://raw.githubusercontent.com/tresacton/dspectrumgui/master/public/screenshot.png)\n\n# Installation \nStep by step instructions for Kali Linux (Debian based OS), and MAC OSX, are both available in the wiki: \n<https://github.com/tresacton/dspectrumgui/wiki>\n\n\n# Features\n* Community can trivially donate reverse engineering worksheet templates\n* Users can trivially import donated reverse engineering worksheet templates\n* Ability to store device metadata and transmission binary\n* Wraps Inspectrum and uses its \"Extract Symbols\" feature to help convert pulses into raw binary\n* Automatic analysis of the binary to determine the modulation and encoding types (see Supported modulation types)\n* Some error detection and verbose comments where the app believes it knows which modulation type would have been valid if the user better aligned the symbols in Inspectrum (particularly where significant whitespace was missed in PWM or where symbols are misaligned for Manchester)\n* Reverse Engineering Worksheet to help you visualise the packet structure and comment on sections of the signal\n* Binary Generation for RFCat transmission\n\n# Do I need any hardware?\nYou do if you need to capture transmissiosn from your device. An RTL-SDR, a HackRF, or anything else that will work with tools like osmocom_fft (which is the recommended way to capture your transmission for use with this tool). If you're just here to try it out and have no hardware, find a CFILE/IQ file on the internet for a simple device and give it a shot. As long as its a format supported by Inspectrum, you're good to go.\n\n# How does it work?\nAssuming you have already captured some signals (Osmocom_fft is great for this!), and have created a new \"Device\" and \"Unit\" in DSpectrumGUI, you can click the link \"Add New Capture\". The application will then spawn an instance of Inspectrum. Once you've appropriately adjusted your symbol/grid overlay in Inspectrum, and asked it to \"extract symbols\", DSpectrumGUI will then convert that data into a binary string and attempt to automatically demodulate/decode it for you. It also provides a database for you to store pertinent information such as the frequency, baudrate, and FCC ID of the device for your future reference.\n\nWhen you have some demodulated signals and navigate to the \"Reverse Engineering Worksheet\" for the device, DSpectrumGUI will present you with a form that allows you to define your own definitions for each section of the data (e.g. marking the first 'n' bits as the Device Identifier string - if that's what you discover they represent), and record your notes/observations about that section as you are working. This is very useful as you are reverse engineering your device. It allows you to keep all of your notes and observations in once place, in a structured and organised manner. Once you're satisfied with your demodulation and reverse engineering, you can choose to share your section definitions as a template for other DSpectrumGUI users to benefit from. \n\nThe reverse engineering worksheet view also helps you to view some common binary to integer translations for your defined sections, and gives you some code you can use to attempt to generate your own signals using RFCat. \n\n# Supported Modulation/Encoding\n* Pulse-width Modulation (PWM) - 77/25 duty cycle version, and 66/33 duty cycle version\n* Frequency Shift Keying (2FSK) - though the app will treat it as OOK\n* On-off Keying (OOK) / Amplitude Shift Keying (ASK)\n* Manchester encoding - both \"G. E. Thomas\" format, and \"IEE 802\" format\n\n# Usage\nThe wiki will be updated as I have time. In the interim, there's a high-level PDF guide I developed for a workshop which demonstrates the basic use of this application. It's available here: \n[DSpectrumGUI Reverse Engineering Guide](https://github.com/tresacton/dspectrumgui/raw/master/public/DSpectrumGUI%20%E2%80%93%20Reverse%20Engineering%20Guide.pdf) \n\n## License\nLicensing is AGPL by default for personal use. An MIT license is available for purchase for commercial use. \n\n \n \n"
  },
  {
    "path": "Rakefile",
    "content": "# Add your own tasks in files placed in lib/tasks ending in .rake,\n# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.\n\nrequire File.expand_path('../config/application', __FILE__)\n\nRails.application.load_tasks\n"
  },
  {
    "path": "SECURITY.md",
    "content": "# Security Policy\n\n## Supported Versions\n\n| Version | Supported          |\n| ------- | ------------------ |\n| Master  | :white_check_mark: |\n| v1.0.0  | :white_check_mark: |\n\n\n## Reporting a Vulnerability\n\nOpen an issue. This isn't a production / public facing tool, and it can be run in a VM in isolation (with a local only connection) as it doesn't interface directly with any SDR/RF hardware to mitigate risks. If you found a vuln, chances are someone else has too. Add it in as an issue here for all to see so I'm pressured to do something about it =P\nThat said - this application isn't intended to have a high security maturity. I'll certainly make an effort to fix things where possible.\nFeel empowered to help me out by submitting a pull request for a fix. If it seems sound and doesn't break anything, I'll pull it into the codebase.\n\nThanks xD\n"
  },
  {
    "path": "app/assets/images/.keep",
    "content": ""
  },
  {
    "path": "app/assets/javascripts/advisories.coffee",
    "content": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be available in application.js.\n# You can use CoffeeScript in this file: http://coffeescript.org/\n"
  },
  {
    "path": "app/assets/javascripts/advisory_comments.coffee",
    "content": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be available in application.js.\n# You can use CoffeeScript in this file: http://coffeescript.org/\n"
  },
  {
    "path": "app/assets/javascripts/application.js",
    "content": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,\n// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.\n//\n// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the\n// compiled file.\n//\n// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details\n// about supported directives.\n//\n//= require jquery\n//= require jquery_ujs\n//= require turbolinks\n//= require jquery.turbolinks\n//= require bootstrap-sprockets\n//= require_tree ."
  },
  {
    "path": "app/assets/javascripts/captures.coffee",
    "content": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be available in application.js.\n# You can use CoffeeScript in this file: http://coffeescript.org/\n"
  },
  {
    "path": "app/assets/javascripts/categories.coffee",
    "content": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be available in application.js.\n# You can use CoffeeScript in this file: http://coffeescript.org/\n"
  },
  {
    "path": "app/assets/javascripts/challenge_attempts.coffee",
    "content": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be available in application.js.\n# You can use CoffeeScript in this file: http://coffeescript.org/\n"
  },
  {
    "path": "app/assets/javascripts/challenges.coffee",
    "content": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be available in application.js.\n# You can use CoffeeScript in this file: http://coffeescript.org/\n"
  },
  {
    "path": "app/assets/javascripts/dashboard.coffee",
    "content": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be available in application.js.\n# You can use CoffeeScript in this file: http://coffeescript.org/\n"
  },
  {
    "path": "app/assets/javascripts/devices.coffee",
    "content": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be available in application.js.\n# You can use CoffeeScript in this file: http://coffeescript.org/\n"
  },
  {
    "path": "app/assets/javascripts/messages.coffee",
    "content": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be available in application.js.\n# You can use CoffeeScript in this file: http://coffeescript.org/\n"
  },
  {
    "path": "app/assets/javascripts/product_versions.coffee",
    "content": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be available in application.js.\n# You can use CoffeeScript in this file: http://coffeescript.org/\n"
  },
  {
    "path": "app/assets/javascripts/products.coffee",
    "content": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be available in application.js.\n# You can use CoffeeScript in this file: http://coffeescript.org/\n"
  },
  {
    "path": "app/assets/javascripts/profile.coffee",
    "content": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be available in application.js.\n# You can use CoffeeScript in this file: http://coffeescript.org/\n"
  },
  {
    "path": "app/assets/javascripts/sections.coffee",
    "content": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be available in application.js.\n# You can use CoffeeScript in this file: http://coffeescript.org/\n"
  },
  {
    "path": "app/assets/javascripts/submission.coffee",
    "content": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be available in application.js.\n# You can use CoffeeScript in this file: http://coffeescript.org/\n"
  },
  {
    "path": "app/assets/javascripts/triage.coffee",
    "content": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be available in application.js.\n# You can use CoffeeScript in this file: http://coffeescript.org/\n"
  },
  {
    "path": "app/assets/javascripts/units.coffee",
    "content": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be available in application.js.\n# You can use CoffeeScript in this file: http://coffeescript.org/\n"
  },
  {
    "path": "app/assets/javascripts/vendors.coffee",
    "content": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be available in application.js.\n# You can use CoffeeScript in this file: http://coffeescript.org/\n"
  },
  {
    "path": "app/assets/stylesheets/advisories.scss",
    "content": "// Place all the styles related to the Advisories controller here.\n// They will automatically be included in application.css.\n// You can use Sass (SCSS) here: http://sass-lang.com/\n"
  },
  {
    "path": "app/assets/stylesheets/advisory_comments.scss",
    "content": "// Place all the styles related to the AdvisoryComments controller here.\n// They will automatically be included in application.css.\n// You can use Sass (SCSS) here: http://sass-lang.com/\n"
  },
  {
    "path": "app/assets/stylesheets/application.scss",
    "content": "/*\n * This is a manifest file that'll be compiled into application.css, which will include all the files\n * listed below.\n *\n * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,\n * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.\n *\n * You're free to add application-wide styles to this file and they'll appear at the bottom of the\n * compiled file so the styles you add here take precedence over styles defined in any styles\n * defined in the other CSS/SCSS files in this directory. It is generally better to create a new\n * file per style scope.\n *\n *= require_tree .\n *= require_self\n */\n// \"bootstrap-sprockets\" must be imported before \"bootstrap\" and \"bootstrap/variables\"\n@import \"bootstrap-sprockets\";\n@import \"bootstrap\";\n@import \"bootstrap.min\";\n\n@font-face {\n  font-family: \"neuropol\";\n  src: asset-url('neuropol.ttf') format('truetype'),\n\n}\n\n.neuro {\n\tfont-family: 'neuropol';\n}\n\n.nounderline{text-decoration: none}\n\n\n\n"
  },
  {
    "path": "app/assets/stylesheets/captures.scss",
    "content": "// Place all the styles related to the Captures controller here.\n// They will automatically be included in application.css.\n// You can use Sass (SCSS) here: http://sass-lang.com/\n"
  },
  {
    "path": "app/assets/stylesheets/categories.scss",
    "content": "// Place all the styles related to the Categories controller here.\n// They will automatically be included in application.css.\n// You can use Sass (SCSS) here: http://sass-lang.com/\n"
  },
  {
    "path": "app/assets/stylesheets/challenge_attempts.scss",
    "content": "// Place all the styles related to the ChallengeAttempts controller here.\n// They will automatically be included in application.css.\n// You can use Sass (SCSS) here: http://sass-lang.com/\n"
  },
  {
    "path": "app/assets/stylesheets/challenges.scss",
    "content": "// Place all the styles related to the Challenges controller here.\n// They will automatically be included in application.css.\n// You can use Sass (SCSS) here: http://sass-lang.com/\n"
  },
  {
    "path": "app/assets/stylesheets/dashboard.scss",
    "content": "// Place all the styles related to the Dashboard controller here.\n// They will automatically be included in application.css.\n// You can use Sass (SCSS) here: http://sass-lang.com/\n\n.mcontainer {\n  width: 100%;\n  height: 10em;\n  margin: 1em auto;\n  overflow: hidden;\n  /*background: grey;*/\n  position: bottom;\n  box-sizing: border-box;\n}\n\n.right {\n  float:right;\n}\n\n.marquee {\n  top: 6em;\n  position: relative;\n  box-sizing: border-box;\n  animation: marquee 15s linear infinite;\n  &:hover {\n    animation-play-state: paused;\n  }\n}\n\n/* Make it move! */\n@keyframes marquee {\n  0% {\n    top: 8em;\n  }\n\n  100% {\n    top: -11em;\n  }\n}\n\n\n/* Make it look pretty */\n\n.microsoft {\n  .marquee {\n    margin: 0;\n    padding: 0 1em;\n    line-height: 1.5em;\n    font: 1em 'Segoe UI', Tahoma, Helvetica, Sans-Serif;\n  }\n  &:before, &::before, &:after, &::after {\n    left: 0;\n    z-index: 1;\n    content: '';\n    position: absolute;\n    pointer-events: none;\n    width: 100%;\n    height: 2em;\n    background-image: linear-gradient(top, black, rgba(255, 255, 255, 0));\n  }\n  &:after, &::after {\n    bottom: 0;\n    transform: rotate(180deg);\n  }\n  &:before, &::before {\n    top: 0;\n  }\n}\n\n/* Style the links */\n\n.vanity {\n  color: black;\n  text-align: center;\n  font: .75em 'Segoe UI', Tahoma, Helvetica, Sans-Serif;\n  a {\n    color: #1570A6;\n    transition: color .5s;\n    text-decoration: none;\n  }\n}\n\n.microsoft a {\n  color: #1570A6;\n  transition: color .5s;\n  text-decoration: none;\n}\n\n.vanity a:hover, .microsoft a:hover {\n  color: #F65314;\n}\n\n/* Style toggle button */\n\n.toggle {\n  display: block;\n  margin: 2em auto;\n}"
  },
  {
    "path": "app/assets/stylesheets/devices.scss",
    "content": "// Place all the styles related to the Devices controller here.\n// They will automatically be included in application.css.\n// You can use Sass (SCSS) here: http://sass-lang.com/\n"
  },
  {
    "path": "app/assets/stylesheets/messages.scss",
    "content": "// Place all the styles related to the Messages controller here.\n// They will automatically be included in application.css.\n// You can use Sass (SCSS) here: http://sass-lang.com/\n"
  },
  {
    "path": "app/assets/stylesheets/product_versions.scss",
    "content": "// Place all the styles related to the ProductVersions controller here.\n// They will automatically be included in application.css.\n// You can use Sass (SCSS) here: http://sass-lang.com/\n"
  },
  {
    "path": "app/assets/stylesheets/products.scss",
    "content": "// Place all the styles related to the Products controller here.\n// They will automatically be included in application.css.\n// You can use Sass (SCSS) here: http://sass-lang.com/\n"
  },
  {
    "path": "app/assets/stylesheets/profile.scss",
    "content": "// Place all the styles related to the profile controller here.\n// They will automatically be included in application.css.\n// You can use Sass (SCSS) here: http://sass-lang.com/\n"
  },
  {
    "path": "app/assets/stylesheets/researcher.scss",
    "content": "// Place all the styles related to the researcher controller here.\n// They will automatically be included in application.css.\n// You can use Sass (SCSS) here: http://sass-lang.com/\n"
  },
  {
    "path": "app/assets/stylesheets/scaffolds.scss",
    "content": "body {\n  background-color: #fff;\n  color: #333;\n  font-family: verdana, arial, helvetica, sans-serif;\n  font-size: 13px;\n  line-height: 18px;\n}\nbutton.plus { background-image: url(image_path('plus.png')); }\np, ol, ul, td {\n  font-family: verdana, arial, helvetica, sans-serif;\n  font-size: 13px;\n  line-height: 18px;\n}\n\npre {\n  background-color: #eee;\n  padding: 10px;\n  font-size: 11px;\n}\n\na {\n  color: #000;\n\n  &:visited {\n    color: #666;\n  }\n\n  &:hover {\n    color: #fff;\n    background-color: #000;\n  }\n}\n\ndiv {\n  &.field, &.actions {\n    margin-bottom: 10px;\n  }\n}\n\n#notice {\n  color: green;\n}\n\n.field_with_errors {\n  padding: 2px;\n  background-color: red;\n  display: table;\n}\n\n#error_explanation {\n  width: 450px;\n  border: 2px solid red;\n  padding: 7px;\n  padding-bottom: 0;\n  margin-bottom: 20px;\n  background-color: #f0f0f0;\n\n  h2 {\n    text-align: left;\n    font-weight: bold;\n    padding: 5px 5px 5px 15px;\n    font-size: 12px;\n    margin: -7px;\n    margin-bottom: 0px;\n    background-color: #c00;\n    color: #fff;\n  }\n\n  ul li {\n    font-size: 12px;\n    list-style: square;\n  }\n}\n"
  },
  {
    "path": "app/assets/stylesheets/sections.scss",
    "content": "// Place all the styles related to the Sections controller here.\n// They will automatically be included in application.css.\n// You can use Sass (SCSS) here: http://sass-lang.com/\n"
  },
  {
    "path": "app/assets/stylesheets/submission.scss",
    "content": "// Place all the styles related to the submission controller here.\n// They will automatically be included in application.css.\n// You can use Sass (SCSS) here: http://sass-lang.com/\n"
  },
  {
    "path": "app/assets/stylesheets/triage.scss",
    "content": "// Place all the styles related to the Triage controller here.\n// They will automatically be included in application.css.\n// You can use Sass (SCSS) here: http://sass-lang.com/\n"
  },
  {
    "path": "app/assets/stylesheets/units.scss",
    "content": "// Place all the styles related to the Units controller here.\n// They will automatically be included in application.css.\n// You can use Sass (SCSS) here: http://sass-lang.com/\n"
  },
  {
    "path": "app/assets/stylesheets/vendors.scss",
    "content": "// Place all the styles related to the Vendors controller here.\n// They will automatically be included in application.css.\n// You can use Sass (SCSS) here: http://sass-lang.com/\n"
  },
  {
    "path": "app/controllers/application_controller.rb",
    "content": "class ApplicationController < ActionController::Base\n  # Prevent CSRF attacks by raising an exception.\n  # For APIs, you may want to use :null_session instead.\n  protect_from_forgery with: :exception\n  before_filter :authenticate_user!\nend\n"
  },
  {
    "path": "app/controllers/captures_controller.rb",
    "content": "class CapturesController < ApplicationController\n  before_action :set_capture, only: [:show, :edit, :update, :destroy, :shift_left, :shift_right]\n\n  require 'pty'\n\n  # GET /captures\n  # GET /captures.json\n  def index\n    @captures = Capture.all\n  end\n\n  # GET /captures/1\n  # GET /captures/1.json\n  def show\n  end\n\n  def shift_right\n    @capture.shift_right\n    redirect_to :back\n  end\n\n  def shift_left\n    @capture.shift_left\n    redirect_to :back\n  end\n\n  # GET /captures/new\n  def new\n    @capture = Capture.new(unit_id:params[:unit_id],device_id:params[:device_id])\n    # dd\n    # `inspectrum`\n\n\n    cmd = 'inspectrum'\n    begin\n      PTY.spawn(cmd) do |r, stdin, pid|\n        begin\n          got_it = false\n\n          loop do\n            if !got_it\n              line = r.gets\n              raw = line.chomp.strip.split(',')\n              puts \"\\n[*] Data as array: #{raw}\" \n              if raw.count > 1\n                demod = ''\n                arr = raw\n                threshold = arr.inject { |sum, el| sum + el }.to_f / arr.size\n                raw.to_a.each do |r|\n                  r.to_f > threshold.to_f ? demod << '1' : demod << '0'\n                end\n\n                # threshold safety check start\n\n                # threshold_safety_check raw, threshold\n                # threshold safety check end\n\n                # hex = print_results demod\n                # compare demod\n                @capture.original_binary = demod\n                got_it = true unless demod == ''\n              end\n            else\n              break\n            end\n          end\n          Process.kill 'INT', pid\n        rescue Errno::EIO\n          puts '[!] Errno:EIO error, this may just mean the process has finished giving output'.colorize(:red)\n          Process.kill 'INT', pid\n        end\n      end\n    rescue PTY::ChildExited\n      puts '[!] The child process exited!'.colorize(:red)\n    end\n\n\n\n\n  end\n\n  # GET /captures/1/edit\n  def edit\n  end\n\n  # POST /captures\n  # POST /captures.json\n  def create\n    @capture = Capture.new(capture_params)\n\n    respond_to do |format|\n      if @capture.save\n        @capture.binary = @capture.original_binary\n        @capture.save\n        puts \"the above update occured on create...\"\n        format.html { redirect_to @capture.unit, notice: 'Capture was successfully created.' }\n        format.json { render :show, status: :created, location: @capture }\n      else\n        format.html { render :new }\n        format.json { render json: @capture.errors, status: :unprocessable_entity }\n      end\n    end\n  end\n\n  # PATCH/PUT /captures/1\n  # PATCH/PUT /captures/1.json\n  def update\n    respond_to do |format|\n      if @capture.update(capture_params)\n        format.html { redirect_to @capture, notice: 'Capture was successfully updated.' }\n        format.json { render :show, status: :ok, location: @capture }\n      else\n        format.html { render :edit }\n        format.json { render json: @capture.errors, status: :unprocessable_entity }\n      end\n    end\n  end\n\n  # DELETE /captures/1\n  # DELETE /captures/1.json\n  def destroy\n    @capture.destroy\n    respond_to do |format|\n      format.html { redirect_to captures_url, notice: 'Capture was successfully destroyed.' }\n      format.json { head :no_content }\n    end\n  end\n\n  private\n    # Use callbacks to share common setup or constraints between actions.\n    def set_capture\n      begin\n        @capture = Capture.find(params[:id])\n      rescue\n        @capture = Capture.find(params[:capture_id])\n      end\n    end\n\n    # Never trust parameters from the scary internet, only allow the white list through.\n    def capture_params\n      params.require(:capture).permit(:unit_id, :device_id, :name, :notes, :binary, :original_binary)\n    end\nend\n"
  },
  {
    "path": "app/controllers/concerns/.keep",
    "content": ""
  },
  {
    "path": "app/controllers/dashboard_controller.rb",
    "content": "class DashboardController < ApplicationController\n  skip_before_filter :authenticate_user!, only: [:about]\n\n\n\n  def about\n    `git fetch`\n  \t@tags = `git describe --tags`\n  \t@version = `git log -n 1 --pretty=format:\"%H\"`\n  \t@count_behind_origin = `git rev-list master..origin/master --count`.to_i\n  end\n\n\n\n  def temp\n\n  end\n\n  def contribute\n  \t@cont = `cat #{Rails.root.join('mcs', 'contribution.md').to_s}` \n  end\n\n\nend\n"
  },
  {
    "path": "app/controllers/devices_controller.rb",
    "content": "class DevicesController < ApplicationController\n  require 'csv'\n  before_action :set_device, only: [:show, :edit, :update, :destroy]\n\n  # GET /devices\n  # GET /devices.json\n  def index\n    @devices = Device.all\n  end\n\n  # GET /devices/1\n  # GET /devices/1.json\n  def show\n    @unit = Unit.new(device_id:params[:id])\n    @without_baseline = params[:without_baseline].present? ? true : false\n  end\n\n  # GET /devices/new\n  def new\n    @device = Device.new\n  end\n\n  # GET /devices/1/edit\n  def edit\n  end\n\n  # POST /devices\n  # POST /devices.json\n  def create\n    @device = Device.new(device_params)\n\n    respond_to do |format|\n      if @device.save\n        format.html { redirect_to @device, notice: 'Device was successfully created.' }\n        format.json { render :show, status: :created, location: @device }\n      else\n        format.html { render :new }\n        format.json { render json: @device.errors, status: :unprocessable_entity }\n      end\n    end\n  end\n\n  # PATCH/PUT /devices/1\n  # PATCH/PUT /devices/1.json\n  def update\n    respond_to do |format|\n      if @device.update(device_params)\n        format.html { redirect_to @device, notice: 'Device was successfully updated.' }\n        format.json { render :show, status: :ok, location: @device }\n      else\n        format.html { render :edit }\n        format.json { render json: @device.errors, status: :unprocessable_entity }\n      end\n    end\n  end\n\n  # DELETE /devices/1\n  # DELETE /devices/1.json\n  def destroy\n    @device.destroy\n    respond_to do |format|\n      format.html { redirect_to :back, notice: 'Device was successfully destroyed.' }\n      format.json { head :no_content }\n    end\n  end\n\n  def apply_template\n    @device = Device.find params[:device_id]\n    @template = SectionTemplate.find params[:template][:template_id]\n\n    the_csv = CSV.parse(@template.sections, :headers => true, :encoding => 'ISO-8859-1')\n    the_csv.each do |row|\n      s = Section.new\n      s.device_id = @device.id\n      s.start_pos = row['start_pos']\n      s.end_pos = row['end_pos']\n      s.name = row['name']\n      s.notes = row['notes']\n      s.colour = row['colour']\n      s.save\n    end\n    redirect_to :back, :notice => \"Successfully imported sections\"\n    \n  end\n\n  private\n    # Use callbacks to share common setup or constraints between actions.\n    def set_device\n      @device = Device.find(params[:id])\n    end\n\n    # Never trust parameters from the scary internet, only allow the white list through.\n    def device_params\n      params.require(:device).permit(:fcc_id, :baudrate, :frequency, :modulation, :encoding, :name, :notes, :flip_pwm)\n    end\nend\n"
  },
  {
    "path": "app/controllers/registrations_controller.rb",
    "content": "class RegistrationsController < Devise::RegistrationsController\n  skip_before_filter :authenticate_user!\n\n\n  private\n\n  def sign_up_params\n    params.require(:user).permit(:full_name, :email, :password, :password_confirmation)\n  end\n\n  def account_update_params\n    params.require(:user).permit(:full_name, :email, :password, :password_confirmation, :current_password)\n  end\nend\n"
  },
  {
    "path": "app/controllers/section_templates_controller.rb",
    "content": "class SectionTemplatesController < ApplicationController\n  before_action :set_section_template, only: [:show]\n\n  # GET /section_templates\n  # GET /section_templates.json\n  def index\n    @section_templates = SectionTemplate.all\n  end\n\n  # GET /section_templates/1\n  # GET /section_templates/1.json\n  def show\n  end\n\n  def create\n    @device = Device.find params[:section_template][:device_id]\n    @device.sections_to_csv params[:section_template][:name], params[:section_template][:added_by]\n    redirect_to controller: 'dashboard', action: 'contribute'\n  end\n\n  \n  private\n    # Use callbacks to share common setup or constraints between actions.\n    def set_section_template\n      @section_template = SectionTemplate.find(params[:id])\n    end\n\n    # Never trust parameters from the scary internet, only allow the white list through.\n    def section_template_params\n      params.require(:section_template).permit(:name, :sections, :added_by)\n    end\nend\n"
  },
  {
    "path": "app/controllers/sections_controller.rb",
    "content": "class SectionsController < ApplicationController\n  before_action :set_section, only: [:show, :edit, :update, :destroy]\n\n  # GET /sections\n  # GET /sections.json\n  def index\n    @device = Device.find params[:device_id]\n    @sections = @device.sections.sort_by(&:start_pos)\n    @section = Section.new(device_id: @device.id)\n  end\n\n  # GET /sections/1\n  # GET /sections/1.json\n  def show\n  end\n\n  # GET /sections/new\n  def new\n    @section = Section.new\n  end\n\n  # GET /sections/1/edit\n  def edit\n  end\n\n  # POST /sections\n  # POST /sections.json\n  def create\n    @section = Section.new(section_params)\n\n    respond_to do |format|\n      if @section.save\n        format.html { redirect_to device_sections_path(@section.device,@section), notice: 'Section was successfully created.' }\n        format.json { render :show, status: :created, location: @section }\n      else\n        format.html { render :new }\n        format.json { render json: @section.errors, status: :unprocessable_entity }\n      end\n    end\n  end\n\n  # PATCH/PUT /sections/1\n  # PATCH/PUT /sections/1.json\n  def update\n    respond_to do |format|\n      if @section.update(section_params)\n        format.html { redirect_to device_sections_path(@section.device,@section), notice: 'Section was successfully updated.' }\n        format.json { render :show, status: :ok, location: @section }\n      else\n        format.html { render :edit }\n        format.json { render json: @section.errors, status: :unprocessable_entity }\n      end\n    end\n  end\n\n  # DELETE /sections/1\n  # DELETE /sections/1.json\n  def destroy\n    @section.destroy\n    respond_to do |format|\n      format.html { redirect_to device_sections_path(@section.device,@section), notice: 'Section was successfully destroyed.' }\n      format.json { head :no_content }\n    end\n  end\n\n  private\n    # Use callbacks to share common setup or constraints between actions.\n    def set_section\n      @section = Section.find(params[:id])\n    end\n\n    # Never trust parameters from the scary internet, only allow the white list through.\n    def section_params\n      params.require(:section).permit(:device_id, :name, :notes, :start_pos, :end_pos, :colour)\n    end\nend\n"
  },
  {
    "path": "app/controllers/units_controller.rb",
    "content": "class UnitsController < ApplicationController\n  before_action :set_unit, only: [:show, :edit, :update, :destroy]\n\n  # GET /units\n  # GET /units.json\n  def index\n    @units = Unit.all\n  end\n\n  # GET /units/1\n  # GET /units/1.json\n  def show\n    @manchester_format = params[:manchester_format]\n    @pwm_format  = params[:pwm_format]\n  end\n\n  # GET /units/new\n  def new\n    @unit = Unit.new(device_id:params[:device_id])\n  end\n\n  # GET /units/1/edit\n  def edit\n  end\n\n  # POST /units\n  # POST /units.json\n  def create\n    @unit = Unit.new(unit_params)\n\n    respond_to do |format|\n      if @unit.save\n        format.html { redirect_to @unit.device, notice: 'Unit was successfully created.' }\n        format.json { render :show, status: :created, location: @unit }\n      else\n        format.html { render :new }\n        format.json { render json: @unit.errors, status: :unprocessable_entity }\n      end\n    end\n  end\n\n  # PATCH/PUT /units/1\n  # PATCH/PUT /units/1.json\n  def update\n    respond_to do |format|\n      if @unit.update(unit_params)\n        format.html { redirect_to @unit, notice: 'Unit was successfully updated.' }\n        format.json { render :show, status: :ok, location: @unit }\n      else\n        format.html { render :edit }\n        format.json { render json: @unit.errors, status: :unprocessable_entity }\n      end\n    end\n  end\n\n  # DELETE /units/1\n  # DELETE /units/1.json\n  def destroy\n    @unit.destroy\n    respond_to do |format|\n      format.html { redirect_to :back, notice: 'Unit was successfully destroyed.' }\n      format.json { head :no_content }\n    end\n  end\n\n  private\n    # Use callbacks to share common setup or constraints between actions.\n    def set_unit\n      @unit = Unit.find(params[:id])\n    end\n\n    # Never trust parameters from the scary internet, only allow the white list through.\n    def unit_params\n      params.require(:unit).permit(:device_id, :name, :notes)\n    end\nend\n"
  },
  {
    "path": "app/helpers/application_helper.rb",
    "content": "module ApplicationHelper\nend\n"
  },
  {
    "path": "app/helpers/captures_helper.rb",
    "content": "module CapturesHelper\nend\n"
  },
  {
    "path": "app/helpers/dashboard_helper.rb",
    "content": "module DashboardHelper\nend\n"
  },
  {
    "path": "app/helpers/devices_helper.rb",
    "content": "module DevicesHelper\nend\n"
  },
  {
    "path": "app/helpers/section_templates_helper.rb",
    "content": "module SectionTemplatesHelper\nend\n"
  },
  {
    "path": "app/helpers/sections_helper.rb",
    "content": "module SectionsHelper\nend\n"
  },
  {
    "path": "app/helpers/units_helper.rb",
    "content": "module UnitsHelper\nend\n"
  },
  {
    "path": "app/models/.keep",
    "content": ""
  },
  {
    "path": "app/models/capture.rb",
    "content": "class Capture < ActiveRecord::Base\n  belongs_to :unit\n  belongs_to :device\n\n\n  def flip bin\n    flipped = \"\"\n    bin.scan(/./).each do |b|\n      b == '1' ? flipped << '0' : flipped << '1'\n    end\n    flipped\n  end\n\n  def check_signals shift=false\n    if shift\n      manchester_failures = {}\n      shifted_bin = '0' << original_binary\n      shifted_bin.scan(/../).each do |pair|\n        manchester_failures[pair]='invalid manchester' if (pair != \"10\") and (pair != \"01\")\n      end\n    else\n      manchester_failures = {}\n      original_binary.scan(/../).each do |pair|\n        manchester_failures[pair]='invalid manchester' if (pair != \"10\") and (pair != \"01\")\n      end\n    end\n    manchester_failures\n  end\n\n  def pwm_decode # 66/33\n    # 66/33 Format PWM\n    symbols = \"\"\n    the_bin = original_binary\n    while ((the_bin.size % 3) != 0)\n      the_bin+='0'\n    end\n    the_bin.scan(/.../).each do |s|\n      # 100 == 0\n      # 110 == 1\n      symbols << \"1\" if s.to_i == 110\n      symbols << \"0\" if s.to_i == 100\n    end\n\n\n    symbols = (device.flip_pwm ? (flip symbols) : symbols)\n  end\n\n  def pwm_decode_7525\n    # 66/33 Format PWM\n    symbols = \"\"\n    the_bin = original_binary\n    while ((the_bin.size % 3) != 0)\n      the_bin+='0'\n    end\n    the_bin.scan(/..../).each do |s|\n      # 100 == 0\n      # 110 == 1\n      symbols << \"1\" if s.to_i == 1110\n      symbols << \"0\" if s.to_i == 1000\n    end\n    symbols = (device.flip_pwm ? (flip symbols) : symbols)\n  end\n\n\n  def valid_pwm? human=false\n\n    pwm_errors = {}\n    the_bin = original_binary\n    fixed_incomplete = false\n    pre_padded_zero_alignment_error = false # The Dr Nick Edge Case\n\n    if the_bin.scan(/./)[0] == '0'\n      pre_padded_zero_alignment_error = true\n      pwm_errors[the_bin.last]='shifted and possibly irrepairably incomplete pwm'\n      the_bin = the_bin[1..-1]\n    end\n\n    if ((the_bin.size % 3) != 0)\n      pwm_errors[the_bin.last]='incomplete pwm'  \n      while ((the_bin.size % 4) != 0)\n        the_bin+='0'\n      end\n    end\n\n\n    the_bin.scan(/.../).each do |set|\n      pwm_errors[set]='invalid pwm' if (set != \"110\") and (set != \"100\")\n    end\n\n    shared_pwm_valid_response pwm_errors, the_bin, fixed_incomplete, pre_padded_zero_alignment_error, human\n\n  end\n\n  def valid_pwm_7525? human=false\n\n    pwm_errors = {}\n    the_bin = original_binary\n    fixed_incomplete = false\n    pre_padded_zero_alignment_error = false # The Dr Nick Edge Case\n\n    if the_bin.scan(/./)[0] == '0'\n      pre_padded_zero_alignment_error = true\n      pwm_errors[the_bin.last]='shifted and possibly irrepairably incomplete pwm'\n      the_bin = the_bin[1..-1]\n    end\n\n    if ((the_bin.size % 4) != 0)\n      pwm_errors[the_bin.last]='incomplete pwm'  \n      while ((the_bin.size % 4) != 0)\n        the_bin+='0'\n      end\n    end\n\n\n    the_bin.scan(/..../).each do |set|\n      pwm_errors[set]='invalid pwm' if (set != \"1110\") and (set != \"1000\")\n    end\n\n  \n    shared_pwm_valid_response pwm_errors, the_bin, fixed_incomplete, pre_padded_zero_alignment_error, human\n\n  end\n\n  def shared_pwm_valid_response pwm_errors, the_bin, fixed_incomplete, pre_padded_zero_alignment_error, human\n    message = nil\n    if pwm_errors.present?\n      if pwm_errors.count == 1\n        if pwm_errors.has_value? 'incomplete pwm'\n          #message = \"Valid PWM if padding at end was captured. Re-capture with padding and delete this item for best results.\"\n          message = \"This was valid PWM but significant whitespace at the end was missed by you. I have added 0s to the end and saved the change.\"\n          fixed_incomplete = true\n        end \n        if (pwm_errors.has_value? \"shifted and possibly irrepairably incomplete pwm\") && (!pwm_errors.has_value? \"invalid pwm\")\n          message = \"This is likely to be a PWM capture but there was an unexpected '0' at the beginning which suggests the last cell was also chopped off. It is STRONGLY recommended that you re-create this capture but this time start one cell later, and add an extra cell at the end even if it is empty. This is an edge-case that seems to occur rarely with rtl-sdr captures. We don't know why exactly.\"\n        end\n      end\n    end\n    \n    if human == false\n      if fixed_incomplete && pwm_errors.size == 1\n        return true\n      else\n        return pwm_errors.blank?\n      end\n    else\n      response = \"\"\n      if pwm_errors.blank?\n        response = \"Yes\"\n      elsif pwm_errors.present?\n        if message.blank?\n          response << \"No\"\n        else\n          self.original_binary = self.binary = the_bin\n          self.save unless pwm_errors.has_value? \"shifted and possibly irrepairably incomplete pwm\"\n          response << message # message will only show first time. gone from subsequent attempts due to being corrected and saved\n        end\n      end\n      response\n    end\n  end\n\n\n  def manchester_decode\n    symbols = \"\"\n    original_binary.scan(/../).each do |s|\n      symbols += '1' if s.to_i == 10\n      symbols += '0' if s.to_i == 01\n    end\n    symbols\n  end\n\n  def valid_manchester? human=false\n    if human == false\n      check_signals.blank?\n    else\n      response = \"\"\n      if check_signals.blank? then\n        response = \"Yes\"\n      else\n        check_signals(shift=true).blank? ? response << \"\\n If you add a 0 at the start it is... re-capture the signal with an empty cell at the beginning\" : response << \"No\"\n      end\n\n      response\n    end\n  end\n\n  def to_hexcode bin=nil\n    hex = ''\n    f_hex = '\\x'\n    if bin\n      hex << '%02x' % bin.to_i(2)\n      f_hex << hex.scan(/.{2}|.+/).join('\\x')\n    else\n      hex << '%02x' % original_binary.to_i(2)\n      f_hex << hex.scan(/.{2}|.+/).join('\\x')\n    end\n    f_hex\n  end\n\n  def to_ascii manchester=false, pwm=false\n    if manchester\n      f_hex = to_hexcode manchester_decode.gsub(\"\\\\x\",\"\")\n      \"#{f_hex.gsub(/../) { |pair| pair.hex.chr }}\".force_encoding(Encoding::UTF_8).encode('utf-8', :invalid=>:replace, :replace=>\"?\")\n    elsif pwm\n      f_hex = to_hexcode pwm_decode.gsub(\"\\\\x\",\"\")\n      \"#{f_hex.gsub(/../) { |pair| pair.hex.chr }}\".force_encoding(Encoding::UTF_8).encode('utf-8', :invalid=>:replace, :replace=>\"?\")\n    else\n      f_hex = to_hexcode\n      \"#{f_hex.gsub(/../) { |pair| pair.hex.chr }}\".force_encoding(Encoding::UTF_8).encode('utf-8', :invalid=>:replace, :replace=>\"?\")\n    end\n  end\n\n  def bin_to_ascii bin\n    f_hex = to_hexcode bin\n    \"#{f_hex.gsub(/../) { |pair| pair.hex.chr }}\".force_encoding(Encoding::UTF_8).encode('utf-8', :invalid=>:replace, :replace=>\"?\")\n  end\n\n  def shift_right\n    update_attribute(:binary, binary.scan(/\\w/).unshift('p'))\n    save\n  end\n\n  def shift_left\n    if binary.scan(/\\w/).first == 'p'\n      update_attribute(:binary, binary.scan(/\\w/).drop(1))\n      save\n    end\n  end\n\n  def self.to_hexcode bin\n    hex = ''\n    f_hex = '\\x'\n    hex << '%02x' % bin.to_i(2)\n    f_hex << hex.scan(/.{2}|.+/).join('\\x')\n    \n\n    if f_hex.split(\"\\\\x\").last.size == 1\n      f_hex << \"0\"\n    end\n    f_hex\n  end\n\nend\n"
  },
  {
    "path": "app/models/concerns/.keep",
    "content": ""
  },
  {
    "path": "app/models/cons.rb",
    "content": "class Cons \n  # this isn't an active record model. it's soley here to help with console commands for usability\n\n  def self.live_capture_seed_file device_id, unit_id, capture_name, stop_at_first=false\n    first_bin = \"\"\n    last_bin = \"\"\n\n    d = Device.find device_id\n    u = Unit.find unit_id\n\n    loop.with_index do |_, i| \n      c = Capture.new\n      c.unit_id = u.id\n      c.device_id = d.id\n      c.name = \"#{capture_name}_#{i+1}\"\n      until !c.new_record?\n        bin = `cat \"#{Rails.root}/tmp/test_change.tmp\"`.gsub(\"\\\\n\",\"\")\n        if (bin.to_s != last_bin) && (bin.to_s.present?)\n          break if (bin.to_s == first_bin) && (stop_at_first == true)\n          c.original_binary = bin.to_s\n          c.binary = c.original_binary\n          c.save\n          last_bin = c.original_binary\n        end\n      end\n    end\n  end\n\n\nend\n"
  },
  {
    "path": "app/models/device.rb",
    "content": "class Device < ActiveRecord::Base\n  require 'csv'\n  has_many :units, dependent: :destroy\n  has_many :captures\n  has_many :sections\n\n  def could_be_manchester?\n    captures.map(&:valid_manchester?).any?\n  end\n\n  def could_be_pwm?\n    captures.map(&:valid_pwm?).any?\n  end\n\n  def could_be_pwm_7525?\n    captures.map(&:valid_pwm_7525?).any?\n  end\n\n  def update_modulation\n    if (modulation == \"OOK\" && encoding == \"n/a\") || (modulation.blank? && encoding.blank?)\n      if could_be_pwm?\n        update_attribute(:modulation,\"PWM\")\n        update_attribute(:encoding,\"66/33\")\n      elsif could_be_pwm_7525?\n        update_attribute(:modulation,\"PWM\")\n        update_attribute(:encoding,\"75/25\")\n      elsif could_be_manchester?\n        update_attribute(:modulation,\"OOK\")\n        update_attribute(:encoding,\"Manchester\")\n      else\n        update_attribute(:modulation,\"OOK\")\n        update_attribute(:encoding,\"n/a\")\n      end\n    end\n  end\n\n  def format_frequency\n    number_of_decimals = decimals(frequency)\n    pad = 5 - number_of_decimals\n    frequency.to_s.gsub(\".\",\"\") + (\"0\"*pad)\n  end\n\n  def decimals(a)\n    num = 0\n    while(a != a.to_i)\n        num += 1\n        a *= 10\n    end\n    num   \n  end\n\n  # export a section template\n  def sections_to_csv template_name, added_by\n    column_names = \"name\", \"start_pos\", \"end_pos\", \"colour\", \"notes\"\n\n    the_csv = CSV.generate(headers: true) do |csv_text|\n      csv_text << column_names\n      sections.each do |section|\n        csv_text << section.attributes.values_at(*column_names)\n      end\n    end\n    the_csv.gsub('\"',\"'\")\n    open(Rails.root.join('mcs', 'contribution.md').to_s, 'w') {|f|\n      f.puts \"```ruby\"\n      f.puts \"SectionTemplate.find_or_create_by(:name => \\\"#{template_name}\\\") do |st|\"\n      f.puts \"  st.sections = \\\"#{the_csv}\\\" \"\n      f.puts \"  st.added_by = '#{added_by}' \"\n      f.puts \"end\"\n      f.puts \"```\"\n    }\n  end\n\n\nend\n"
  },
  {
    "path": "app/models/section.rb",
    "content": "class Section < ActiveRecord::Base\n  belongs_to :device\n\n  def section_range \n    start_pos..end_pos\n  end\n\nend\n"
  },
  {
    "path": "app/models/section_template.rb",
    "content": "class SectionTemplate < ActiveRecord::Base\nend\n"
  },
  {
    "path": "app/models/unit.rb",
    "content": "class Unit < ActiveRecord::Base\n  belongs_to :device\n  has_many :captures, dependent: :destroy\n\nend\n"
  },
  {
    "path": "app/models/user.rb",
    "content": "class User < ActiveRecord::Base\n  # Include default devise modules. Others available are:\n  # :confirmable, :lockable, :timeoutable and :omniauthable\n  devise :database_authenticatable, :registerable, :rememberable, :trackable\n\n\nend\n"
  },
  {
    "path": "app/views/application/_favicon.html.erb",
    "content": "<link rel=\"apple-touch-icon\" sizes=\"57x57\" href=\"<%= asset_path 'favicon/apple-touch-icon-57x57.png' %>\">\n<link rel=\"apple-touch-icon\" sizes=\"60x60\" href=\"<%= asset_path 'favicon/apple-touch-icon-60x60.png' %>\">\n<link rel=\"apple-touch-icon\" sizes=\"72x72\" href=\"<%= asset_path 'favicon/apple-touch-icon-72x72.png' %>\">\n<link rel=\"apple-touch-icon\" sizes=\"76x76\" href=\"<%= asset_path 'favicon/apple-touch-icon-76x76.png' %>\">\n<link rel=\"apple-touch-icon\" sizes=\"114x114\" href=\"<%= asset_path 'favicon/apple-touch-icon-114x114.png' %>\">\n<link rel=\"apple-touch-icon\" sizes=\"120x120\" href=\"<%= asset_path 'favicon/apple-touch-icon-120x120.png' %>\">\n<link rel=\"apple-touch-icon\" sizes=\"144x144\" href=\"<%= asset_path 'favicon/apple-touch-icon-144x144.png' %>\">\n<link rel=\"apple-touch-icon\" sizes=\"152x152\" href=\"<%= asset_path 'favicon/apple-touch-icon-152x152.png' %>\">\n<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"<%= asset_path 'favicon/apple-touch-icon-180x180.png' %>\">\n<link rel=\"icon\" type=\"image/png\" href=\"<%= asset_path 'favicon/favicon-32x32.png' %>\" sizes=\"32x32\">\n<link rel=\"icon\" type=\"image/png\" href=\"<%= asset_path 'favicon/android-chrome-192x192.png' %>\" sizes=\"192x192\">\n<link rel=\"icon\" type=\"image/png\" href=\"<%= asset_path 'favicon/favicon-96x96.png' %>\" sizes=\"96x96\">\n<link rel=\"icon\" type=\"image/png\" href=\"<%= asset_path 'favicon/favicon-16x16.png' %>\" sizes=\"16x16\">\n<link rel=\"manifest\" href=\"<%= asset_path 'favicon/manifest.json' %>\">\n<link rel=\"mask-icon\" href=\"<%= asset_path 'favicon/safari-pinned-tab.svg' %>\" color=\"#5bbad5\">\n<link rel=\"shortcut icon\" href=\"<%= asset_path 'favicon/favicon.ico' %>\">\n<meta name=\"msapplication-TileColor\" content=\"#da532c\">\n<meta name=\"msapplication-TileImage\" content=\"<%= asset_path 'favicon/mstile-144x144.png' %>\">\n<meta name=\"msapplication-config\" content=\"<%= asset_path 'favicon/browserconfig.xml' %>\">\n<meta name=\"theme-color\" content=\"#ffffff\">"
  },
  {
    "path": "app/views/captures/_form.html.haml",
    "content": "= simple_form_for(@capture) do |f|\n  = f.error_notification\n\n  = f.hidden_field :device_id\n  = f.hidden_field :unit_id\n  = f.hidden_field :original_binary\n\n  .form-group\n    %label.col-lg-2.control-label{:for => \"inputEmail\"} Name\n    .col-lg-10\n      = f.input :name, label: false, input_html: { class: 'form-control' }\n      %br\n\n\n  .form-group\n    .col-lg-10.col-lg-offset-2\n      /-#%button.btn.btn-default{:type => \"reset\"} Cancel\n      %button.btn.btn-primary{:type => \"submit\"} Submit\n"
  },
  {
    "path": "app/views/captures/edit.html.haml",
    "content": "%h1 Editing capture\n\n= render 'form'\n\n= link_to 'Show', @capture\n\\|\n= link_to 'Back', captures_path\n"
  },
  {
    "path": "app/views/captures/index.html.haml",
    "content": "%h1 Listing captures\n\n%table\n  %thead\n    %tr\n      %th Unit\n      %th Device\n      %th Name\n      %th Notes\n      %th Binary\n      %th Original binary\n      %th\n      %th\n      %th\n\n  %tbody\n    - @captures.each do |capture|\n      %tr\n        %td= capture.unit_id\n        %td= capture.device_id\n        %td= capture.name\n        %td= capture.notes\n        %td= capture.binary\n        %td= capture.original_binary\n        %td= link_to 'Show', capture\n        %td= link_to 'Edit', edit_capture_path(capture)\n        %td= link_to 'Destroy', capture, :method => :delete, :data => { :confirm => 'Are you sure?' }\n\n%br\n\n= link_to 'New Capture', new_capture_path\n"
  },
  {
    "path": "app/views/captures/index.json.jbuilder",
    "content": "json.array!(@captures) do |capture|\n  json.extract! capture, :id, :unit_id, :device_id, :name, :notes, :binary, :original_binary\n  json.url capture_url(capture, format: :json)\nend\n"
  },
  {
    "path": "app/views/captures/new.html.haml",
    "content": "%fieldset\n  %legend Add Capture From Inspectrum\n\n\n  = render 'form'\n\n= link_to 'Back', @capture.unit\n"
  },
  {
    "path": "app/views/captures/show.html.haml",
    "content": "%p#notice= notice\n\n%p\n  %b Unit:\n  = @capture.unit_id\n%p\n  %b Device:\n  = @capture.device_id\n%p\n  %b Name:\n  = @capture.name\n%p\n  %b Notes:\n  = @capture.notes\n%p\n  %b Binary:\n  = @capture.binary\n%p\n  %b Original binary:\n  = @capture.original_binary\n\n= link_to 'Edit', edit_capture_path(@capture)\n\\|\n= link_to 'Back', captures_path\n"
  },
  {
    "path": "app/views/captures/show.json.jbuilder",
    "content": "json.extract! @capture, :id, :unit_id, :device_id, :name, :notes, :binary, :original_binary, :created_at, :updated_at\n"
  },
  {
    "path": "app/views/dashboard/about.html.haml",
    "content": "%div.container-fluid\n  %div.row\n    %div.col-lg-12\n      %h4 DSpectrumGUI \n      %br\n      %p DSpectrumGUI is a locally hosted web application designed to facilitate the rapid reverse engineering of SDR/RF signals.\n      %hr\n      %h5 Application Status\n      %p= \"You are currently running: #{@tags} || #{@version}\"\n      - if @count_behind_origin == 0\n        %p{:style => \"color:darkgreen;\"}= \"This app is up-to-date with master\"\n      - else\n        - message = \"This app is #{@count_behind_origin} \" + \"commit\".pluralize(@count_behind_origin) + \" behind origin/master. If you'd like to update it, shutdown this server (ctrl-c in the terminal window you launched it from), and type the following commands in your terminal\"\n        %p{:style => \"color:darkred;\"}= message\n        %pre{:style => \"white-space: pre-line;background-color:grey;\"}\n          cd ~/dspectrum_gui # update this if you've clone DSpectrumGUI somewhere else\n          git fetch\n          git checkout master\n          git pull origin master\n          rake db:migrate # just incase a change to the database was made\n          %br\n          \\# launch the app again\n          rails s -p 3001\n      %br\n      %br\n  %p.vanity\n    %a=\"Want to stay in touch? &nbsp;&nbsp;&nbsp;&nbsp;\".html_safe\n    %a= \"-&nbsp;&nbsp;&nbsp;&nbsp;\".html_safe \n        \n    %a{:href => \"https://twitter.com/tresacton\"}=\"  @tresacton (on twitter) &nbsp;&nbsp;&nbsp;&nbsp;\".html_safe\n    %a= \"- &nbsp;&nbsp;&nbsp;&nbsp;\".html_safe\n    %a=\"@nullwolf (on slack)&nbsp;&nbsp;&nbsp;&nbsp;\".html_safe\n\n\n\n    / %a \n    /   &copy; AdvisoryDB\n    /   =Time.now.year"
  },
  {
    "path": "app/views/dashboard/contribute.html.haml",
    "content": "%div.container-fluid\n  %div.row\n    %div.col-lg-12\n      %h4 DSpectrumGUI \n      %br\n      %p Please follow the instructions below to contribute\n      %hr\n        %p \n          =\"Navigate to \"\n          =link_to('https://github.com/tresacton/dspectrumgui','https://github.com/tresacton/dspectrumgui').html_safe\n\n        %p= \"Create a new issue with the title: [SectionTemplate] <name of your template>\"\n        %p= \"Copy and paste the below text into the Issue description field, and hit submit\"\n\n\n      \n        %pre{:style => \"white-space: pre-line;background-color:grey;\"}\n          =@cont\n      %br\n      %p Thank you for donating this to our template library.\n      %br\n  %p.vanity\n    %a=\"Want to stay in touch? &nbsp;&nbsp;&nbsp;&nbsp;\".html_safe\n    %a= \"-&nbsp;&nbsp;&nbsp;&nbsp;\".html_safe \n        \n    %a{:href => \"https://twitter.com/tresacton\"}=\"  @tresacton (on twitter) &nbsp;&nbsp;&nbsp;&nbsp;\".html_safe\n    %a= \"- &nbsp;&nbsp;&nbsp;&nbsp;\".html_safe\n    %a=\"@nullwolf (on slack)&nbsp;&nbsp;&nbsp;&nbsp;\".html_safe\n\n\n\n    / %a \n    /   &copy; AdvisoryDB\n    /   =Time.now.year"
  },
  {
    "path": "app/views/dashboard/temp.html.haml",
    "content": "%div.container-fluid\n  %div.row\n    %div.col-lg-12\n      %h3 Analysis Helper\n      %br\n      / -`inspectrum`\n\n      %table.table.table-hover.table-bordered{style:'background-color:black;'}\n        - zero = [1,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1]\n        - one = [nil,1,0,1,0,1,0,1,0,1,0,1,0,1,0]\n        - two = [nil,1,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0]\n        - x1 = [zero,one,two]\n        - x = x1.sort_by {|y|y.size}\n        - baseline = x.last\n        %thead\n          %tr\n            %th \n            -x.last.each_with_index do |it,index|\n              %th{:style => \"color:grey;\"}= index\n            %th \n        %tbody\n\n          - x.each do |barray|\n            %tr\n              %td <\n              - barray.each_with_index do |b, index|\n                - if b == baseline[index]\n                  %td{:style => \"color:green\"}= b\n                -else\n                  %td{:style => \"color:red\"}= b\n              %td >\n          %td b\n          -baseline.each do |b|\n            %td{:style => \"color:blue\"}= b\n          %td\n\n      = form_for '' do | f |\n        =f.label 'notes'\n        %br\n        =f.text_area 'd', :cols => 140\n%br\n"
  },
  {
    "path": "app/views/devices/_add_unit.html.haml",
    "content": "%div.col-lg-12\n  %hr\n  %h4 Units\n  = simple_form_for(unit) do |f|\n    = f.error_notification\n\n    = f.hidden_field :device_id\n    .form-group\n      .col-lg-2\n        %h5 Add new\n      .col-lg-8\n        = f.input :name, placeholder: 'name', label: false, input_html: { class: 'form-control' }\n      .col-lg-2\n        /-#%button.btn.btn-default{:type => \"reset\"} Cancel\n        %button.btn.btn-primary{:type => \"submit\", :style => \"float:right;\"} Create"
  },
  {
    "path": "app/views/devices/_form.html.haml",
    "content": "= simple_form_for(@device) do |f|\n  = f.error_notification\n\n  .form-group\n    %label.col-lg-2.control-label{:for => \"inputEmail\"} Name\n    .col-lg-10\n      = f.input :name, label: false, input_html: { class: 'form-control' }\n      %br\n  .form-group\n    %label.col-lg-2.control-label{:for => \"inputPassword\"} FCC ID\n    .col-lg-10\n      = f.input :fcc_id, label: false, input_html: { class: 'form-control' }\n      %br\n  .form-group\n    %label.col-lg-2.control-label{:for => \"inputPassword\"} Modulation\n    .col-lg-10\n      = f.input :modulation, label: false, input_html: { class: 'form-control' }\n      %br\n  .form-group\n    %label.col-lg-2.control-label{:for => \"inputPassword\"} Encoding\n    .col-lg-10\n      = f.input :encoding, label: false, input_html: { class: 'form-control' }\n      %br\n  .form-group\n    %label.col-lg-2.control-label{:for => \"inputPassword\"} Frequency\n    .col-lg-10\n      = f.input :frequency, label: false, input_html: { class: 'form-control' }\n      %br\n  .form-group\n    %label.col-lg-2.control-label{:for => \"inputPassword\"} Baudrate\n    .col-lg-10\n      = f.input :baudrate, label: false, input_html: { class: 'form-control' }\n      %br\n  .form-group\n    %label.col-lg-2.control-label{:for => \"inputPassword\"} Flip Decoding Assumption\n    .col-lg-10\n      %span{:style => \"float:right;\"}\n        = f.input :flip_pwm, label: false, as: :boolean, checked_value: true, unchecked_value: false \n      %br\n      %br\n      %br\n  .form-group\n    %label.col-lg-2.control-label{:for => \"notes\"} Notes\n    .col-lg-10\n      = f.input :notes, label: false, type: 'text-area', input_html: { class: 'form-control textArea', rows: 10 }\n      %br\n\n\n  .form-group\n    .col-lg-10.col-lg-offset-2\n      /-#%button.btn.btn-default{:type => \"reset\"} Cancel\n      %button.btn.btn-primary{:type => \"submit\"} Submit"
  },
  {
    "path": "app/views/devices/_manchester_analysis.html.haml",
    "content": "- if device.units.map(&:captures).flatten.present?\n  - if device.could_be_manchester?\n    %div.col-lg-12\n      %hr\n      %h4 Manchester Bit Position Analysis Tool\n\n      %p The longest binary string is used as the comparison baseline (B) below\n      %br\n      / -`inspectrum`\n\n      %table.table.table-hover.table-bordered{style:'background-color:black;'}\n        - x1 = device.units.map(&:captures).flatten.each\n\n        - x = x1.sort_by {|y|y.manchester_decode.scan(/\\w/).count}\n        - baseline = x.last.manchester_decode.scan(/\\w/)\n        - x.each do |xx|\n          - diff = baseline.count - xx.manchester_decode.scan(/\\w/).count\n          - if diff > 0\n            - diff.times do |i|\n              - xx.binary = xx.manchester_decode << 'p'\n        %thead\n          %tr\n            %th\n            -baseline.flatten.each_with_index do |it,index|\n              %th{:style => \"color:grey;\"}= index\n        %tbody\n\n          - x.each do |barray|\n            %tr\n              %td\n                = link_to \"#{barray.unit.name}: \",barray.unit, :style => \"color:#2a9fd6;\"\n                %br\n                = barray.name\n              - barray.manchester_decode.scan(/\\w/).each_with_index do |b, index|\n                - if b == baseline[index]\n                  - if b != 'p'\n                    %td.text-success= b\n                  - else\n                    %td\n                -else\n                  - if b != 'p'\n                    %td.text-danger= b\n                  - else\n                    %td\n          %td{style:\"text-align:center;\"} B\n          -baseline.each do |b|\n            - if b != 'p'\n              %td.text-primary= b\n            - else\n              %td\n\n      %br\n      /       Taken from line 13 under flatten\n      /       - device.units.map(&:captures).flatten.each do |c|\n      /         - c.update_attribute(:binary, c.manchester_decode) if c.binary.blank?\n"
  },
  {
    "path": "app/views/devices/_pwm_analysis.html.haml",
    "content": "- if device.units.map(&:captures).flatten.present?\n  - if device.could_be_pwm?\n    %div.col-lg-12\n      %hr\n      %h4 PWM Bit Position Analysis Tool (66/33)\n\n      %p The longest binary string is used as the comparison baseline (B) below\n      %br\n      / -`inspectrum`\n\n      %table.table.table-hover.table-bordered{style:'background-color:black;'}\n        - x1 = device.units.map(&:captures).flatten.each\n\n        - x = x1.sort_by {|y|y.pwm_decode.scan(/\\w/).count}\n        - baseline = x.last.pwm_decode.scan(/\\w/)\n        - x.each do |xx|\n          - diff = baseline.count - xx.pwm_decode.scan(/\\w/).count\n          - if diff > 0\n            - diff.times do |i|\n              - xx.binary = xx.pwm_decode << 'p'\n        %thead\n          %tr\n            %th\n            -baseline.flatten.each_with_index do |it,index|\n              %th{:style => \"color:grey;\"}= index\n        %tbody\n\n          - x.each do |barray|\n            %tr\n              %td\n                = link_to \"#{barray.unit.name}: \",barray.unit, :style => \"color:#2a9fd6;\"\n                %br\n                = barray.name\n              - barray.pwm_decode.scan(/\\w/).each_with_index do |b, index|\n                - if b == baseline[index]\n                  - if b != 'p'\n                    %td.text-success= b\n                  - else\n                    %td\n                -else\n                  - if b != 'p'\n                    %td.text-danger= b\n                  - else\n                    %td\n          %td{style:\"text-align:center;\"} B\n          -baseline.each do |b|\n            - if b != 'p'\n              %td.text-primary= b\n            - else\n              %td\n\n      %br\n\n\n  - if device.could_be_pwm_7525?\n    %div.col-lg-12\n      %hr\n      %h4 PWM Bit Position Analysis Tool (75/25)\n\n      %p The longest binary string is used as the comparison baseline (B) below\n      %br\n      / -`inspectrum`\n\n      %table.table.table-hover.table-bordered{style:'background-color:black;'}\n        - x1 = device.units.map(&:captures).flatten.each\n\n        - x = x1.sort_by {|y|y.pwm_decode_7525.scan(/\\w/).count}\n        - baseline = x.last.pwm_decode_7525.scan(/\\w/)\n        - x.each do |xx|\n          - diff = baseline.count - xx.pwm_decode_7525.scan(/\\w/).count\n          - if diff > 0\n            - diff.times do |i|\n              - xx.binary = xx.pwm_decode_7525 << 'p'\n        %thead\n          %tr\n            %th\n            -baseline.flatten.each_with_index do |it,index|\n              %th{:style => \"color:grey;\"}= index\n        %tbody\n\n          - x.each do |barray|\n            %tr\n              %td\n                = link_to \"#{barray.unit.name}: \",barray.unit, :style => \"color:#2a9fd6;\"\n                %br\n                = barray.name\n              - barray.pwm_decode_7525.scan(/\\w/).each_with_index do |b, index|\n                - if b == baseline[index]\n                  - if b != 'p'\n                    %td.text-success= b\n                  - else\n                    %td\n                -else\n                  - if b != 'p'\n                    %td.text-danger= b\n                  - else\n                    %td\n          %td{style:\"text-align:center;\"} B\n          -baseline.each do |b|\n            - if b != 'p'\n              %td.text-primary= b\n            - else\n              %td\n\n      %br\n\n"
  },
  {
    "path": "app/views/devices/_raw_analysis.html.haml",
    "content": "- if device.units.map(&:captures).flatten.any?\n  %div.col-lg-12\n    %hr\n    %h4 Analysis Helper\n    %p The longest binary string is used as the comparison baseline (B)\n    %br\n    / -`inspectrum`\n\n    %table.table.table-hover.table-bordered{style:'background-color:black;'}\n      - x1 = device.units.map(&:captures).flatten.each\n      - device.units.map(&:captures).flatten.each do |c|\n        - c.update_attribute(:binary, c.original_binary) if c.binary.blank?\n      - x = x1.sort_by {|y|y.original_binary.scan(/\\w/).count}\n      - baseline = x.last.original_binary.scan(/\\w/)\n      - x.each do |xx|\n        - diff = baseline.count - xx.original_binary.scan(/\\w/).count\n        - xx.binary = xx.original_binary\n        - if diff > 0\n          - diff.times do |i|\n            - xx.binary = xx.binary << 'p'\n      %thead\n        %tr\n          %th\n          -baseline.flatten.each_with_index do |it,index|\n            %th{:style => \"color:grey;\"}= index\n      %tbody\n\n        - x.each do |barray|\n          %tr\n            %td\n              = link_to \"#{barray.unit.name}: \",barray.unit, :style => \"color:#2a9fd6;\"\n              %br\n              = barray.name\n            - barray.binary.scan(/\\w/).each_with_index do |b, index|\n              - if without_baseline == false\n                - if b == baseline[index]\n                  - if b != 'p'\n                    %td.text-success= b\n                  - else\n                    %td\n                -else\n                  - if b != 'p'\n                    %td.text-danger= b\n                  - else\n                    %td\n              - elsif without_baseline == true\n                - if b.to_s == '1'\n                  %td.text-success= b\n                - else\n                  %td.text-danger= b\n\n      - if without_baseline == false\n        %td{style:\"text-align:center;\"} B\n        -baseline.each do |b|\n          - if b != 'p'\n            %td.text-primary= b\n          - else\n            %td\n\n    %br"
  },
  {
    "path": "app/views/devices/_show_units.html.haml",
    "content": "%div.col-lg-12\n  %br\n  %table.table.table-bordered.table.hover\n    %thead\n      %tr.bg-primary\n        %th Name\n        %th Notes\n        %th Captures\n        %th Actions\n    %tbody\n      - device.units.each do |u|\n        %tr\n          %td= link_to u.name, u, :style => \"color:#2a9fd6;\"\n          %td= u.notes\n          %td= u.captures.count\n          -#- u.captures.each do |c|\n          -#  = \"#{c.name} \"\n          -#  %br\n          -#  =\" #{c.original_binary}\\n\"\n          -#  %hr\n          %td{:style => \"width:15%;\"}\n            = link_to 'Destroy', u, :method => :delete, :data => { :confirm => 'Are you sure?' }, :style => \"color:red;\"\n"
  },
  {
    "path": "app/views/devices/edit.html.haml",
    "content": "%h1 Editing device\n\n= render 'form'\n\n= link_to 'Show', @device\n\\|\n= link_to 'Back', devices_path\n"
  },
  {
    "path": "app/views/devices/index.html.haml",
    "content": "%div.container-fluid\n  %div.row\n    %div.col-lg-12\n      %h3\n        Devices\n      %p A device is effectively a category. It should have at least one unit. If you have multiple units of the same type (e.g. 3 identical garage door remotes), they are best represented as multiple units of the same device.\n      %br\n\n\n\n\n    %table.table.table-bordered.table-hover\n      %thead\n        %tr.bg-primary\n          %th Name\n          %th FCC ID\n          %th Modulation\n          %th Encoding\n          %th Baudrate\n          %th Frequency\n          %th Notes\n          %th\n\n      %tbody\n        - @devices.each do |device|\n          %tr\n            %td= link_to device.name, device\n            %td= device.fcc_id\n            %td= device.modulation\n            %td= device.encoding\n            %td= device.baudrate\n            %td= device.frequency\n            %td= device.notes.truncate(100)\n            %td\n              = link_to 'Edit', edit_device_path(device)\n              = link_to 'Destroy', device, :method => :delete, :data => { :confirm => 'Are you sure?' }\n\n%br\n\n= link_to 'New Device', new_device_path\n"
  },
  {
    "path": "app/views/devices/index.json.jbuilder",
    "content": "json.array!(@devices) do |device|\n  json.extract! device, :id, :fcc_id, :baudrate, :frequency, :modulation, :encoding, :name, :notes\n  json.url device_url(device, format: :json)\nend\n"
  },
  {
    "path": "app/views/devices/new.html.haml",
    "content": "%fieldset\n  %legend New Device\n\n\n  = render 'form'\n\n= link_to 'Back', devices_path\n"
  },
  {
    "path": "app/views/devices/show.html.haml",
    "content": "%div.container-fluid\n  %div.row\n    %div.col-lg-12\n      %h3\n        Device:\n        = @device.name\n        - @device.update_modulation\n      %p A device is effectively a category. It should have at least one unit. If you have multiple units of the same type (e.g. 3 identical garage door remotes), they are best represented as multiple units of the same device.\n      %br\n\n      %div.col-lg-8\n        %table.table.table-bordered\n          %tr\n            %th.bg-primary{style:\"width:15%;\"} Name\n            %td= @device.name\n          %tr\n            %th.bg-primary FCC ID\n            %td= @device.fcc_id\n          %tr\n            %th.bg-primary Modulation\n            %td\n              = @device.modulation\n          %tr\n            %th.bg-primary Encoding\n            %td= @device.encoding\n          %tr\n            %th.bg-primary Frequency\n            %td\n              = @device.frequency\n              = ' Mhz'\n          %tr\n            %th.bg-primary Baudrate\n            %td= @device.baudrate\n          %tr\n            %th.bg-primary Decoding Rules\n            %td= @device.flip_pwm == true ? \"Bits flipped after demodulation\" : \"Bits not flipped (Default State)\"\n          %tr\n            %th.bg-primary Notes\n            %td= @device.notes\n\n      %div.col-lg-3\n        .well.well-lg\n          %h5 Actions\n          = link_to 'View Reversing Worksheet', device_sections_path(@device), :style => \"color:#2a9fd6;\"\n          %br\n          =link_to 'Edit Device', edit_device_path(@device), :style => \"color:#2a9fd6;\"\n          %br\n          = link_to 'Go Back to Devices', devices_path, :style => \"color:#2a9fd6;\"\n\n\n\n    =render \"manchester_analysis\", device: @device, without_baseline: @without_baseline\n\n\n    / =render \"manchester_analysis\", unit: @unit\n    =render \"pwm_analysis\", device: @device, without_baseline: @without_baseline\n    / =render \"raw_analysis\", unit: @unit\n\n\n    =render \"raw_analysis\", device: @device, without_baseline: @without_baseline\n\n\n    =render \"add_unit\", unit: @unit\n    =render \"show_units\", device: @device\n\n\n  %br\n\n-#Vertical text style for TH\n-#%th{:style => \"color:grey;-webkit-transform: rotate(-90deg);-moz-transform: rotate(-90deg);-ms-transform: rotate(-90deg);-o-transform: rotate(-90deg);filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);color: #FFF;text-transform: uppercase;\"} 0"
  },
  {
    "path": "app/views/devices/show.json.jbuilder",
    "content": "json.extract! @device, :id, :fcc_id, :baudrate, :frequency, :modulation, :encoding, :name, :notes, :created_at, :updated_at\n"
  },
  {
    "path": "app/views/devise/confirmations/new.html.erb",
    "content": "<h2>Resend confirmation instructions</h2>\n\n<%= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>\n  <%= f.error_notification %>\n  <%= f.full_error :confirmation_token %>\n\n  <div class=\"form-inputs\">\n    <%= f.input :email, required: true, autofocus: true %>\n  </div>\n\n  <div class=\"form-actions\">\n    <%= f.button :submit, \"Resend confirmation instructions\" %>\n  </div>\n<% end %>\n\n<%= render \"devise/shared/links\" %>\n"
  },
  {
    "path": "app/views/devise/mailer/confirmation_instructions.html.erb",
    "content": "<p>Welcome <%= @email %>!</p>\n\n<p>You can confirm your account email through the link below:</p>\n\n<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>\n"
  },
  {
    "path": "app/views/devise/mailer/password_change.html.erb",
    "content": "<p>Hello <%= @resource.full_name %>!</p>\n\n<p>We're contacting you to notify you that your password has been changed.</p>\n"
  },
  {
    "path": "app/views/devise/mailer/reset_password_instructions.html.erb",
    "content": "<p>Hello <%= @resource.full_name %>!</p>\n\n<p>Someone has requested a link to change your password. You can do this through the link below.</p>\n\n<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token, :host => (Rails.env == 'production' ? \"advisorydb.com\" : \"localhost\")) %></p>\n\n<p>If you didn't request this, please ignore this email.</p>\n<p>Your password won't change until you access the link above and create a new one.</p>"
  },
  {
    "path": "app/views/devise/mailer/unlock_instructions.html.erb",
    "content": "<p>Hello <%= @resource.full_name %>!</p>\n\n<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>\n\n<p>Click the link below to unlock your account:</p>\n\n<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>\n"
  },
  {
    "path": "app/views/devise/passwords/edit.html.haml",
    "content": "%h3 Change your password?\n\n= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| \n  = f.error_notification\n  = f.full_error :reset_password_token\n  %table.table.table-bordered{style:'width:57%;'}\n    %tr\n      %th{style:\"width:30%;padding:10px;\"} Password\n      %td{style:\"color:grey;width:60px;padding:10px;\"}= f.input :password, label: false, required: true, autofocus: true, hint: (\"#{@minimum_password_length} characters minimum\" if @minimum_password_length)\n    %tr\n      %th{style:\"width:30%;padding:10px;\"} Password Confirmation\n      %td{style:\"color:grey;width:60px;padding:10px;\"}=f.input :password_confirmation, label: false, required: true, maxlength:72, size:72\n\n  %div.row{style:'padding-top:20px;'}\n    = f.input :reset_password_token, as: :hidden\n    %div.col-lg-4\n      = f.button :submit, \"Submit\", :class => \"btn btn-primary\"  \n    %div.col-lg-3.form-action{style:'padding-top:5px;'}\n      = render \"devise/shared/links\" \n    %div.col-lg-5{style:'padding-top:5px;'}\n\n\n\n"
  },
  {
    "path": "app/views/devise/passwords/new.html.haml",
    "content": "\n%h3 Forgot your password?\n\n= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| \n\n\t%table.table.table-bordered{style:'width:57%;'}\n\t\t%tr\n\t\t\t%th{style:\"width:30%;padding:10px;\"} Email\n\t\t\t%td{style:\"color:black;;width:60px;padding:10px;\"}= f.text_field :email, required: true, autofocus: true, label: false, size: 40\n \n\n\t%div.row{style:'padding-top:20px;'}\n\t\t%div.col-lg-4\n\t\t\t= f.button :submit, \"Submit\", :class => \"btn btn-primary\"  \n\t\t%div.col-lg-3.form-action{style:'padding-top:5px;'}\n\t\t\t= render \"devise/shared/links\" \n\t\t%div.col-lg-5{style:'padding-top:5px;'}\n\n"
  },
  {
    "path": "app/views/devise/registrations/edit.html.erb",
    "content": "<h2>Edit <%= resource_name.to_s.humanize %></h2>\n\n<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>\n  <%= f.error_notification %>\n\n  <div class=\"form-inputs\">\n    <%= f.input :email, required: true, autofocus: true %>\n\n    <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>\n      <p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p>\n    <% end %>\n\n    <%= f.input :password, autocomplete: \"off\", hint: \"leave it blank if you don't want to change it\", required: false %>\n    <%= f.input :password_confirmation, required: false %>\n    <%= f.input :current_password, hint: \"we need your current password to confirm your changes\", required: true %>\n  </div>\n\n  <div class=\"form-actions\">\n    <%= f.button :submit, \"Update\" %>\n  </div>\n<% end %>\n\n<h3>Cancel my account</h3>\n\n<p>Unhappy? <%= link_to \"Cancel my account\", registration_path(resource_name), data: { confirm: \"Are you sure?\" }, method: :delete %></p>\n\n<%= link_to \"Back\", :back %>\n"
  },
  {
    "path": "app/views/devise/registrations/new.html.haml",
    "content": "\n%h3 Sign Up\n\n%div.row\n\t%div.col-lg-8\n\t\t= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| \n\t\t\t= f.error_notification \n\t\t\t= devise_error_messages!\n\t\t\t%table.table.table-bordered{style:'width:57%;'}\n\t\t\t\t%tbody\n\t\t\t\t\t%tr{style:''}\n\t\t\t\t\t\t%th{style:\"width:30%;padding-top:10px;padding-left:10px;padding-bottom:10px;\"} Name\n\t\t\t\t\t\t%td{style:\"color:black;width:20%;padding:10px;\"}\n\t\t\t\t\t\t\t= f.text_field :full_name, required: true, autofocus: true, label: false, size: 40\n\t\t\t\t\t%tr\n\t\t\t\t\t\t%th{style:\"width:30%;padding-top:10px;padding-left:10px;padding-bottom:10px;\"} Email\n\t\t\t\t\t\t%td{style:\"color:black;padding:10px;\"}= f.text_field :email, required: true, label: false, size: 40\n\t\t\t\t\t%tr\n\t\t\t\t\t\t%th{style:\"width:30%;padding-top:10px;padding-left:10px;padding-bottom:10px;\"} Password\n\t\t\t\t\t\t%td{style:\"color:black;padding:10px;\"}= f.password_field :password, required: true, label: false, autocomplete: false, size: 40\n\t\t\t\t\t%tr\n\t\t\t\t\t\t%th{style:\"width:30%;padding-top:10px;padding-left:10px;padding-bottom:10px;\"} Password Confirmation\n\t\t\t\t\t\t%td{style:\"color:black;padding:10px;\"}= f.password_field :password_confirmation, label: false, required: true, size: 40 \n\t\t \n\n\t\t\t%div.row{style:'padding-top:20px;'}\n\t\t\t\t%div.col-lg-6\n\t\t\t\t\t= f.button :submit, \"Submit\", :class => \"btn btn-primary\" \n\t\t\t\t%div.col-lg-3.form-action{style:'padding-top:5px;'}\n\t\t\t\t\t= render \"devise/shared/links\" \n\t\t\t\t%div.col-lg-4{style:'padding-top:5px;'}\n\n\t%div.col-lg-4\n\n\t\t%strong Things you need to know:\n\t\t%ul\n\t\t%li Registration is required to access challenge information and to allow you to check your challenge solutions. \n\t\t%li We won't email you or give your email address to others. Other participants will not see your email address in the application interface. If you're super concerned, use a fake email address (just make sure you remember it for today).\n\t\t%li This app is hosted in a VM, which will be reset at the end of today. So the data within will be destroyed or de-anonymised.\n\t\t%li{:style => \"color:red;\"} OBLIGATORY DISCLAIMER: Neither myself (Très Acton), or the Platypus hosts, condone criminal activity. By registering, you agree that you will not interpret the simulation challenges as instructions or suggestions to break any state or federal laws. I'm no legal expert, but \"I learned it at a hacker con\" is probably not going to be a suitable defence if you break into someone's garage without the proper owner's consent... \n\n\n\n \n\n"
  },
  {
    "path": "app/views/devise/sessions/new.html.haml",
    "content": "%h3 Authenticate\n\n= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| \n\n\t%table.table.table-bordered{style:'width:57%;'}\n\t\t%tr\n\t\t\t%th{style:\"width:30%;padding:10px;\"}  Email\n\t\t\t%td{style:\"color:black;width:60px;padding:10px;\"}= f.text_field :email, required: true, autofocus: true, label: false, size: 40\n\t\t%tr\n\t\t\t%th{style:\"width:30%;padding-top:10px;padding-left:10px;padding-bottom:10px;\"}  Password\n\t\t\t%td{style:\"color:black;padding:10px;\"}=f.password_field :password, required: true, label: false, autocomplete: false, size: 40\n \n\n\t%div.row{style:'padding-top:20px;'}\n\t\t%div.col-lg-4\n\t\t\t= f.button :submit, \"Submit\", :class => \"btn btn-primary\"  \n\t\t%div.col-lg-3.form-action{style:'padding-top:5px;'}\n\t\t\t= render \"devise/shared/links\" \n\t\t%div.col-lg-5{style:'padding-top:5px;'}\n\t\t\t\n\n\n\n\n \n\n"
  },
  {
    "path": "app/views/devise/shared/_links.html.erb",
    "content": "<div style=\"text-align:right;\">\n\t<%- if controller_name != 'sessions' %>\n\t  <%= link_to \"Log in\", new_session_path(resource_name) %><br />\n\t<% end -%>\n\n\t<%- if devise_mapping.registerable? && controller_name != 'registrations' %>\n\t  <%= link_to \"Sign up\", new_registration_path(resource_name) %><br />\n\t<% end -%>\n\n\t<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>\n\t  <%= link_to \"Forgot your password?\", new_password_path(resource_name) %><br />\n\t<% end -%>\n\n\t<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>\n\t  <%= link_to \"Didn't receive confirmation instructions?\", new_confirmation_path(resource_name) %><br />\n\t<% end -%>\n\n\t<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>\n\t  <%= link_to \"Didn't receive unlock instructions?\", new_unlock_path(resource_name) %><br />\n\t<% end -%>\n\n\t<%- if devise_mapping.omniauthable? %>\n\t  <%- resource_class.omniauth_providers.each do |provider| %>\n\t    <%= link_to \"Sign in with #{OmniAuth::Utils.camelize(provider)}\", omniauth_authorize_path(resource_name, provider) %><br />\n\t  <% end -%>\n\t<% end -%>\n</div>"
  },
  {
    "path": "app/views/devise/unlocks/new.html.haml",
    "content": "\n<h2>Resend unlock instructions</h2>\n\n= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| \n\n\t%table.table.table-bordered{style:'width:57%;'}\n\t\t%tr\n\t\t\t%th{style:\"width:30%;padding:10px;\"}  Email\n\t\t\t%td{style:\"color:black;width:60px;padding:10px;\"}= f.text_field :email, required: true, autofocus: true, label: false, size: 40\n\n \n\n\t%div.row{style:'padding-top:20px;'}\n\t\t%div.col-lg-6\n\t\t\t= f.button :submit, \"Resend unlock instructions\", :class => \"btn btn-primary\" \n\t\t%div.col-lg-3.form-action{style:'padding-top:5px;'}\n\t\t\t= render \"devise/shared/links\" \n\t\t%div.col-lg-5{style:'padding-top:5px;'}\n\n\n\n \n\n"
  },
  {
    "path": "app/views/layouts/_footer.html.erb",
    "content": "<!-- Footer -->\n<div class=\"container\">\n  <hr>\n  <footer>\n      <div class=\"row\">\n          <div class=\"col-lg-12\">\n              <p>Copyright &copy; nullwolf 2016</p>\n          </div>\n      </div>\n  </footer>\n</div>\n<!-- /.container -->\n"
  },
  {
    "path": "app/views/layouts/_messages.html.haml",
    "content": "-# Rails flash messages styled for Bootstrap 3.0\n- flash.each do |name, msg|\n  - if msg.is_a?(String)\n    %div{:class => \"alert alert-#{name.to_s == 'notice' ? 'success' : 'danger'}\"}\n      %button.close{\"aria-hidden\" => \"true\", \"data-dismiss\" => \"alert\", :type => \"button\"} &times;\n      = content_tag :div, msg, :id => \"flash_#{name}\"\n"
  },
  {
    "path": "app/views/layouts/_navigation.html.haml",
    "content": "-# navigation styled for Bootstrap 3.0\n%nav.navbar.navbar-default.navbar-fixed-top\n\n\n\n\n  %a.nounderline{:href => \"/\",style:'float:left;padding-right:20px;padding-left:15px;'}\n    %div{style:'float:left;padding-right:20px;padding-left:15px;'}\n    %h3.neuro /dspectrum/\n    %span.right by nullwolf\n  \n  %button.navbar-toggle{\"data-target\" => \".navbar-collapse\", \"data-toggle\" => \"collapse\", :type => \"button\"}\n    %span.sr-only Toggle navigation\n    %span.icon-bar\n    %span.icon-bar\n    %span.icon-bar\n  / %a.navbar-brand{:href => \"/\", :rel => \"/\", :title => \"\"}\n  %div{style:'float:right;'}\n    \n"
  },
  {
    "path": "app/views/layouts/_navigation_links.html.erb",
    "content": "<%# add navigation links to this file %>\n"
  },
  {
    "path": "app/views/layouts/application.html.haml",
    "content": "!!!\n%html\n  %head\n    = render 'favicon'\n    %meta{:name => \"viewport\", :content => \"width=device-width, initial-scale=1.0\"}\n    %title= content_for?(:title) ? yield(:title) : '/dspectrum/'\n\n    = stylesheet_link_tag 'application', media: 'all'\n    = javascript_include_tag 'bootstrap.min'\n    = javascript_include_tag 'application'\n    = csrf_meta_tags\n  %body\n    %header\n      = render 'layouts/navigation'\n    %main{:role => \"main\",style:\"padding-top:35px;\"}\n      #banner.page-header\n        .row\n          .col-lg-4\n          %br\n          %br\n        \n          %br\n          .col-sm-2\n            .list-group.table-of-contents.navbar-collapse\n              -if current_user.present?\n                %a.list-group-item{:style => \"background-color:black;color:white;\"}= \"Welcome, #{current_user.full_name}\"\n\n                =link_to(\"Devices\", devices_path, :class => \"a list-group-item\", :style => \"background-color:black;\")\n\n\n                =link_to(\"About\", '/about', :class => \"a list-group-item\", :style => \"background-color:black;\")\n\n\n\n              -else\n                %a.list-group-item{:style => \"background-color:black;\",:href => new_user_registration_path, :style => \"background-color:black;\"} Create an account\n                %a.list-group-item{:style => \"background-color:black;\",:href => new_session_path('user'), :style => \"background-color:black;\"} Log in\n              - if @current_user.present? || current_user.present?\n                =link_to(\"Logout\", destroy_user_session_path, :method => :delete, :class => \"a list-group-item\", :style => \"background-color:black;\")\n\n          .col-lg-8.col-md-7.col-sm-6\n            = render 'layouts/messages'\n            = yield \n"
  },
  {
    "path": "app/views/layouts/mailer.html.haml",
    "content": "%hmtl\n  %body\n    = yield"
  },
  {
    "path": "app/views/layouts/mailer.text.haml",
    "content": "= yield"
  },
  {
    "path": "app/views/profile/edit.html.haml",
    "content": "%h1 Profile#edit\n%p Find me in app/views/profile/edit.html.haml\n"
  },
  {
    "path": "app/views/profile/index.html.haml",
    "content": "%h1 Profile#index\n%p Find me in app/views/profile/index.html.haml\n"
  },
  {
    "path": "app/views/profile/show.html.haml",
    "content": "- if @myprofile\n\t%table.table.table-bordered.table-hover\n\t\t%tr\n\t\t\t%th{style:'width:20%;'} Name\n\t\t\t%td= @profile.full_name\n\t\t\n\t\t%tr\n\t\t\t%th Email Address \n\t\t\t%td= \"#{@profile.email} - (this is not visible to other users)\"\n\n\t\t%tr\n\t\t\t%th Became a Member \n\t\t\t%td= \"#{time_ago_in_words(@profile.created_at)} ago\"\n\n\t\t%tr\n\t\t\t%th Sharing your Profile\n\t\t\t- my_url = root_url + 'profile/' + @profile.id.to_s\n\t\t\t- link = link_to my_url, my_url\n\t\t\t%td= \"Your profile can be accessed by others at: #{link}\".html_safe\n\t%br\n              \n              \n\t%hr\n\t%h4 Submissions - (this is not visible to other users)\n\t- if @submissions.any?\n\t\t%table.table.table-bordered.table-hover\n\t\t\t%tr\n\t\t\t\t%th{style:'width:20%;'} ADB ID\n\t\t\t\t%th.visible-lg.visible-md Title \n\t\t\t\t%th.visible-lg.visible-md Description \n\t\t\t\t%th Status \n\t\t\t\t%th Submitted \n\t\t\t\t%th Interactions\n\n\t\t\t%tr\n\t\t\t-@submissions.each do |s|\n\t\t\t\t%tr\n\t\t\t\t\t%td= s.adb_id\n\t\t\t\t\t%td.visible-lg.visible-md= s.title\n\t\t\t\t\t%td.visible-lg.visible-md= s.description\n\t\t\t\t\t%td= s.status.titleize\n\t\t\t\t\t%td= \"#{time_ago_in_words(s.created_at)} ago\"\n\t\t\t\t\t-if s.advisory_comments.count > 0\n\t\t\t\t\t\t%td\n\t\t\t\t\t\t\t= \"#{s.advisory_comments.count} - \"\n\t\t\t\t\t\t\t= link_to 'View', \"/submission/#{s.adb_id}/interactions\"\n\t\t\t\t\t-else\n\t\t\t\t\t\t%td= \"#{s.advisory_comments.count}\"\n\n\n\n\t-else \t\n\t\tNone\n\n\t%hr\n\t%h4 \n\t\tPublished Advisories\n\n\t\t%span.badge{style:\"float:right;font-size:16px;\"}= @advisories.count\n\t- if @advisories.any?\n\n\t\t%table.table.table-striped.table-bordered\n\t\t\t%thead\n\t\t\t\t%tr\n\t\t\t\t\t%th ADB ID  \n\t\t\t\t\t%th Submitted\n\t\t\t\t\t%th.visible-lg.visible-md Category    \n\t\t\t\t\t%th Title\n\t\t\t\t\t%th{style:'text-align:center;'} ADBS\n\n\t\t\t%tbody\n\t\t\t\t- @advisories.each do |advisory|\n\t\t\t\t\t%tr\n\t\t\t\t\t\t%td{style:'width:170px;'}= link_to advisory.adb_id,advisory\n\t\t\t\t\t\t%td= \"#{time_ago_in_words(advisory.created_at)} ago\"\n\t\t\t\t\t\t%td.visible-lg.visible-md= advisory.category.try(:name)\n\t\t\t\t\t\t%td= advisory.title\n\t\t\t\t\t\t%td{style:'text-align:center;'}\n\t\t\t\t\t\t\t%p\n\t\t\t\t\t\t\t\t- if advisory.score\n\t\t\t\t\t\t\t\t\t- if advisory.score < 5\n\t\t\t\t\t\t\t\t\t\t%span.label.label-success{style:'font-size:100%;'}= \"ADBS: #{advisory.score}\"\n\t\t\t\t\t\t\t\t\t- if advisory.score >= 5 && advisory.score < 7\n\t\t\t\t\t\t\t\t\t\t%span.label.label-warning{style:'font-size:100%;'}= \"ADBS: #{advisory.score}\"\n\t\t\t\t\t\t\t\t\t- if advisory.score >= 7\n\t\t\t\t\t\t\t\t\t\t%span.label.label-danger{style:'font-size:100%;'}= \"ADBS: #{advisory.score}\"\n\t\t\t\t\t\t/ ADD CVE to model also add notion of production category\n\t- else\n\t\tNone\n\n\n\n- else\n\t%h3= @profile.full_name\n\n\t%table.table.table-bordered.table-hover\n\t\t%tr\n\t\t\t%th{style:'width:20%;'} Name\n\t\t\t%td= @profile.full_name\n\n\t\t%tr\n\t\t\t%th Became a Member \n\t\t\t%td= \"#{time_ago_in_words(@profile.created_at)} ago\"\n\n\t%hr\n\n\t%h4 \n\t\tPublished Advisories\n\t\t%span.badge{style:\"float:right;font-size:16px;\"}= @advisories.count\n\t- if @advisories.any?\n\n\t\t\n\t\t\n\t\t%table.table.table-striped.table-bordered\n\t\t\t%thead\n\t\t\t\t%tr\n\t\t\t\t\t%th ADB ID  \n\t\t\t\t\t%th Submitted\n\t\t\t\t\t%th.visible-lg.visible-md Category    \n\t\t\t\t\t%th Title\n\t\t\t\t\t%th{style:'text-align:center;'} ADBS\n\n\t\t\t%tbody\n\t\t\t\t- @advisories.each do |advisory|\n\t\t\t\t\t%tr\n\t\t\t\t\t\t%td{style:'width:170px;'}= link_to advisory.adb_id,advisory\n\t\t\t\t\t\t%td= \"#{time_ago_in_words(advisory.created_at)} ago\"\n\t\t\t\t\t\t%td.visible-lg.visible-md= advisory.category.try(:name)\n\t\t\t\t\t\t%td= advisory.title\n\t\t\t\t\t\t%td{style:'text-align:center;'}\n\t\t\t\t\t\t\t%p\n\t\t\t\t\t\t\t\t- if advisory.score\n\t\t\t\t\t\t\t\t\t- if advisory.score < 5\n\t\t\t\t\t\t\t\t\t\t%span.label.label-success{style:'font-size:100%;'}= \"ADBS: #{advisory.score}\"\n\t\t\t\t\t\t\t\t\t- if advisory.score >= 5 && advisory.score < 7\n\t\t\t\t\t\t\t\t\t\t%span.label.label-warning{style:'font-size:100%;'}= \"ADBS: #{advisory.score}\"\n\t\t\t\t\t\t\t\t\t- if advisory.score >= 7\n\t\t\t\t\t\t\t\t\t\t%span.label.label-danger{style:'font-size:100%;'}= \"ADBS: #{advisory.score}\"\n\t\t\t\t\t\t/ ADD CVE to model also add notion of production category\n\t- else\n\t\tNone\n"
  },
  {
    "path": "app/views/section_templates/index.html.haml",
    "content": "%h1 Listing section_templates\n\n%table\n  %thead\n    %tr\n      %th Name\n      %th Sections\n      %th Added by\n      %th\n      %th\n      %th\n\n  %tbody\n    - @section_templates.each do |section_template|\n      %tr\n        %td= section_template.name\n        %td= section_template.sections\n        %td= section_template.added_by\n        %td= link_to 'Show', section_template\n        %td= link_to 'Edit', edit_section_template_path(section_template)\n        %td= link_to 'Destroy', section_template, :method => :delete, :data => { :confirm => 'Are you sure?' }\n\n%br\n\n= link_to 'New Section template', new_section_template_path\n"
  },
  {
    "path": "app/views/section_templates/show.html.haml",
    "content": "%p#notice= notice\n\n%p\n  %b Name:\n  = @section_template.name\n%p\n  %b Sections:\n  = @section_template.sections\n%p\n  %b Added by:\n  = @section_template.added_by\n\n= link_to 'Edit', edit_section_template_path(@section_template)\n\\|\n= link_to 'Back', section_templates_path\n"
  },
  {
    "path": "app/views/sections/_form.html.haml",
    "content": "= simple_form_for(@section) do |f|\n  = f.error_notification\n\n  / .form-inputs\n  /   = f.input :device_id\n  /   = f.input :name\n  /   = f.input :notes\n  /   = f.input :start_pos\n  /   = f.input :end_pos\n  /   = f.input :colour\n\n  / .form-actions\n  /   = f.button :submit\n\n\n\n  = f.hidden_field :device_id\n\n  .form-group\n    %label.col-lg-2.control-label{:for => \"name\"} Name\n    .col-lg-10\n      = f.input :name, label: false, input_html: { class: 'form-control' }\n      %br\n\n\n  .form-group\n    %label.col-lg-2.control-label{:for => \"start_pos\"} Start Position (bit)\n    .col-lg-10\n      = f.input :start_pos, label: false, input_html: { class: 'form-control' }\n      %br\n\n\n  .form-group\n    %label.col-lg-2.control-label{:for => \"end_pos\"} End Position (bit)\n    .col-lg-10\n      = f.input :end_pos, label: false, input_html: { class: 'form-control' }\n      %br\n\n\n  .form-group\n    %label.col-lg-2.control-label{:for => \"notes\"} Notes\n    .col-lg-10\n      = f.input :notes, label: false, type: 'text-area', input_html: { class: 'form-control textArea', rows: 10 }\n      %br\n\n\n  .form-group\n    %label.col-lg-2.control-label{:for => \"colour\"} Colour\n    .col-lg-10\n      - the_options = options_for_select([['gray', 'gray'], ['blue', 'blue'], ['aqua', 'aqua'], ['cadetblue', 'cadetblue'], ['darkblue', 'darkblue'], ['green', 'green'], ['darkgreen', 'darkgreen'], ['red', 'red'], ['darkred', 'darkred'], ['deeppink', 'deeppink'], ['fuchsia', 'fuchsia'], ['indigo', 'indigo'], ['goldenrod', 'goldenrod']],@section.colour)\n      = f.select :colour, the_options, label: false, input_html: { class: 'form-control' }\n      %br\n      %br\n\n\n  .form-group\n    .col-lg-10.col-lg-offset-2\n      /-#%button.btn.btn-default{:type => \"reset\"} Cancel\n      %button.btn.btn-primary{:type => \"submit\"} Submit Definition\n\n      %br\n      %br\n"
  },
  {
    "path": "app/views/sections/_manchester_analysis.html.haml",
    "content": "- if device.units.map(&:captures).flatten.present?\n  - if device.could_be_manchester?\n    %div.col-lg-12\n      %hr\n      %h4 Manchester Bit Position Analysis Tool\n\n      %p The longest binary string is used as the comparison baseline (B) below\n      %br\n      / -`inspectrum`\n\n      %table.table.table-hover.table-bordered{style:'background-color:black;'}\n        - x1 = device.units.map(&:captures).flatten.each\n\n        - x = x1.sort_by {|y|y.manchester_decode.scan(/\\w/).count}\n        - baseline = x.last.manchester_decode.scan(/\\w/)\n        - x.each do |xx|\n          - diff = baseline.count - xx.manchester_decode.scan(/\\w/).count\n          - if diff > 0\n            - diff.times do |i|\n              - xx.binary = xx.manchester_decode << 'p'\n        %thead\n          %tr\n            %th\n            -baseline.flatten.each_with_index do |it,index|\n              - section_bits = []\n              - device.sections.each do |section|\n                -if section.section_range.member? index\n                  - section_bits << index\n                  %th{:style => \"color:white;background:#{section.colour}\"}= index\n              -if section_bits.exclude? index\n                %th{:style => \"color:white;\"}= index\n        %tbody\n\n          - x.each do |barray|\n            %tr\n              %td\n                = link_to \"#{barray.unit.name}: \",barray.unit, :style => \"color:#2a9fd6;\"\n                %br\n                = barray.name\n              - barray.manchester_decode.scan(/\\w/).each_with_index do |b, index|\n                - if b == baseline[index]\n                  - if b != 'p'\n                    %td.text-success= b\n                  - else\n                    %td\n                -else\n                  - if b != 'p'\n                    %td.text-danger= b\n                  - else\n                    %td\n          %td{style:\"text-align:center;\"} B\n          -baseline.each do |b|\n            - if b != 'p'\n              %td.text-primary= b\n            - else\n              %td\n\n      %br\n      /       Taken from line 13 under flatten\n      /       - device.units.map(&:captures).flatten.each do |c|\n      /         - c.update_attribute(:binary, c.manchester_decode) if c.binary.blank?\n"
  },
  {
    "path": "app/views/sections/_no_sections.html.haml",
    "content": "- unless @sections.present?\n  %div.col-lg-12\n    %hr\n    %h4 Sections Defined\n\n    /# %p The longest binary string is used as the comparison baseline (B) below\n    \n    %p No sections have been defined. You can either define your own in the \"Define New Section\" form (scroll down), or import a section template from the library.\n\n    = simple_form_for(:template, url: device_apply_template_path(:deivce_id => @device_id)) do |f|\n      /-#%button.btn.btn-default{:type => \"reset\"} Cancel\n      .col-lg-10\n        = f.input :template_id, collection: SectionTemplate.all, label: false, input_html: { class: 'form-control' }\n        %br\n      .form-group\n        .col-lg-10.col-lg-offset-0\n          %button.btn.btn-primary{:type => \"submit\"} Add sections from template\n    \n\n    \n\n    %br\n\n"
  },
  {
    "path": "app/views/sections/_pwm_analysis.html.haml",
    "content": "- if device.units.map(&:captures).flatten.present?\n  - if device.could_be_pwm?\n    %div.col-lg-12\n      %hr\n      %h4 PWM Bit Position Analysis Tool (66/33) - with Sections\n\n      %p The longest binary string is used as the comparison baseline (B) below\n      %br\n      / -`inspectrum`\n\n      %table.table.table-hover.table-bordered{style:'background-color:black;'}\n        - x1 = device.units.map(&:captures).flatten.each\n\n        - x = x1.sort_by {|y|y.pwm_decode.scan(/\\w/).count}\n        - baseline = x.last.pwm_decode.scan(/\\w/)\n        - x.each do |xx|\n          - diff = baseline.count - xx.pwm_decode.scan(/\\w/).count\n          - if diff > 0\n            - diff.times do |i|\n              - xx.binary = xx.pwm_decode << 'p'\n        %thead\n          %tr\n            %th\n            -baseline.flatten.each_with_index do |it,index|\n              - section_bits = []\n              - device.sections.each do |section|\n                -if section.section_range.member? index\n                  - section_bits << index\n                  %th{:style => \"color:white;background:#{section.colour}\"}= index\n              -if section_bits.exclude? index\n                %th{:style => \"color:white;\"}= index\n        %tbody\n\n          - x.each do |barray|\n            %tr\n              %td\n                = barray.class\n                %br\n                = barray.name\n              - barray.pwm_decode.scan(/\\w/).each_with_index do |b, index|\n                - if b == baseline[index]\n                  - if b != 'p'\n                    %td.text-success= b\n                  - else\n                    %td\n                -else\n                  - if b != 'p'\n                    %td.text-danger= b\n                  - else\n                    %td\n          %td{style:\"text-align:center;\"} B\n          -baseline.each do |b|\n            - if b != 'p'\n              %td.text-primary= b\n            - else\n              %td\n\n      %br\n\n\n  - if device.could_be_pwm_7525?\n    %div.col-lg-12\n      %hr\n      %h4 PWM Bit Position Analysis Tool (75/25) - with Sections\n\n      %p The longest binary string is used as the comparison baseline (B) below\n      %br\n      / -`inspectrum`\n\n      %table.table.table-hover.table-bordered{style:'background-color:black;'}\n        - x1 = device.units.map(&:captures).flatten.each\n\n        - x = x1.sort_by {|y|y.pwm_decode_7525.scan(/\\w/).count}\n        - baseline = x.last.pwm_decode_7525.scan(/\\w/)\n        - x.each do |xx|\n          - diff = baseline.count - xx.pwm_decode_7525.scan(/\\w/).count\n          - if diff > 0\n            - diff.times do |i|\n              - xx.binary = xx.pwm_decode_7525 << 'p'\n        %thead\n          %tr\n            %th\n            -baseline.flatten.each_with_index do |it,index|\n              - section_bits = []\n              - device.sections.each do |section|\n                -if section.section_range.member? index\n                  - section_bits << index\n                  %th{:style => \"color:white;background:#{section.colour}\"}= index\n              -if section_bits.exclude? index\n                %th{:style => \"color:white;\"}= index\n\n\n        %tbody\n\n          - x.each do |barray|\n            %tr\n              %td\n                = barray.unit.name\n                %br\n                = barray.name\n                %br\n                = \"id: #{barray.id}\"\n              - barray.pwm_decode_7525.scan(/\\w/).each_with_index do |b, index|\n                - if b == baseline[index]\n                  - if b != 'p'\n                    %td.text-success= b\n                  - else\n                    %td\n                -else\n                  - if b != 'p'\n                    %td.text-danger= b\n                  - else\n                    %td\n          %td{style:\"text-align:center;\"} B\n          -baseline.each do |b|\n            - if b != 'p'\n              %td.text-primary= b\n            - else\n              %td\n\n      %br\n\n"
  },
  {
    "path": "app/views/sections/_raw_analysis.html.haml",
    "content": "- if device.units.map(&:captures).flatten.any?\n  - vanilla = true\n  - if device.could_be_pwm? || device.could_be_pwm_7525? || device.could_be_manchester?\n    - vanilla = false\n  - if vanilla \n    %div.col-lg-12\n      %hr\n      %h4 Analysis Helper\n      %p The longest binary string is used as the comparison baseline (B)\n      %br\n      / -`inspectrum`\n\n      %table.table.table-hover.table-bordered{style:'background-color:black;'}\n        - x1 = device.units.map(&:captures).flatten.each\n        - device.units.map(&:captures).flatten.each do |c|\n          - c.update_attribute(:binary, c.original_binary) if c.binary.blank?\n        - x = x1.sort_by {|y|y.original_binary.scan(/\\w/).count}\n        - baseline = x.last.original_binary.scan(/\\w/)\n        - x.each do |xx|\n          - diff = baseline.count - xx.original_binary.scan(/\\w/).count\n          - xx.binary = xx.original_binary\n          - if diff > 0\n            - diff.times do |i|\n              - xx.binary = xx.binary << 'p'\n        %thead\n          %tr\n            %th\n            -baseline.flatten.each_with_index do |it,index|\n              - section_bits = []\n              - device.sections.each do |section|\n                -if section.section_range.member? index\n                  - section_bits << index\n                  %th{:style => \"color:white;background:#{section.colour}\"}= index\n              -if section_bits.exclude? index\n                %th{:style => \"color:white;\"}= index\n        %tbody\n\n          - x.each do |barray|\n            %tr\n              %td\n                = link_to \"#{barray.unit.name}: \",barray.unit, :style => \"color:#2a9fd6;\"\n                = barray.name\n              - barray.binary.scan(/\\w/).each_with_index do |b, index|\n                - if b == baseline[index]\n                  - if b != 'p'\n                    %td.text-success= b\n                  - else\n                    %td\n                -else\n                  - if b != 'p'\n                    %td.text-danger= b\n                  - else\n                    %td\n          %td{style:\"text-align:center;\"} B\n          -baseline.each do |b|\n            - if b != 'p'\n              %td.text-primary= b\n            - else\n              %td\n\n      %br"
  },
  {
    "path": "app/views/sections/_rfcat_config.html.haml",
    "content": "%p=\"d.setFreq(#{device.format_frequency})\"\n%p=\"d.setMdmDRate(#{device.baudrate})\"\n%p=\"d.setMdmModulation(MOD_ASK_OOK)\"\n%p=\"d.setMdmSyncMode(0)\"\n/%p=\"d.setMaxPower(0)\"\n%p\n"
  },
  {
    "path": "app/views/sections/_section_transformations.html.haml",
    "content": "%div.col-lg-12\n  %hr\n  %h4 Transformation Scratchpad\n\n  /# %p The longest binary string is used as the comparison baseline (B) below\n  %br\n  / -`inspectrum`\n\n\n  - @sections.each do |section|\n    %h5= section.name\n    %table.table.table-hover.table-bordered{style:'background-color:black;'}\n      %thead\n        %tr\n          %th{:style => \"color:grey;\"} Capture\n          %th{:style => \"color:grey;\"} Binary\n          %th{:style => \"color:grey;\"} Decimal\n          %th{:style => \"color:grey;\"} Flipped Decimal\n      %tbody\n\n        - captures.each do |capture|\n          %tr\n            %th{style:\"background-color:#{section.colour};\"}\n              = capture.unit.name\n              %br\n              = capture.name\n              %br\n              = \"id: #{capture.id}\"\n            %td{:style=>\"min-width:200px;\"}\n              - if device.could_be_pwm_7525?\n                - b=capture.pwm_decode_7525\n              - elsif device.could_be_pwm?\n                - b=capture.pwm_decode\n              - elsif device.could_be_manchester?\n                - b=capture.manchester_decode\n              - else\n                - b=capture.original_binary\n              - section_binary = b[section.start_pos..section.end_pos]\n              = section_binary \n            %td\n              = section_binary.to_i(2)\n            %td\n              = section_binary.gsub(\"1\",\"one\").gsub(\"0\",\"zero\").gsub(\"zero\",\"1\").gsub(\"one\",'0').to_i(2)\n\n  %br\n\n\n\n"
  },
  {
    "path": "app/views/sections/_sections.html.haml",
    "content": "- if @sections.present?\n  %div.col-lg-12\n    %hr\n    %h4 \n      Sections Defined\n      \n\n    /# %p The longest binary string is used as the comparison baseline (B) below\n    %br\n    / -`inspectrum`\n\n    %table.table.table-hover.table-bordered{style:'background-color:black;'}\n      %thead\n        %tr\n          %th{:style => \"color:grey;\"} Name\n          %th{:style => \"color:grey;\"} Start Position\n          %th{:style => \"color:grey;\"} End Position\n          %th{:style => \"color:grey;\"} Colour\n          %th{:style => \"color:grey;\"} Notes\n          %th{:style => \"color:grey;\"}\n      %tbody\n\n        - @sections.each do |section|\n          %tr\n            %th{style:\"background-color:#{section.colour};\"}\n              = section.name\n            %td\n              = section.start_pos\n            %td\n              = section.end_pos\n            %td\n              = section.colour\n            %td\n              = section.notes\n            %td\n              = link_to 'Edit', edit_section_path(section), :style => \"color:#2a9fd6;\"\n              %br\n              = link_to 'Destroy', section, :method => :delete, :data => { :confirm => 'Are you sure?' }, :style => \"color:red;\"\n\n    \n\n    %br\n\n"
  },
  {
    "path": "app/views/sections/edit.html.haml",
    "content": "%h1 Editing section\n\n= render 'form'\n\n= link_to 'Show', @section\n\\|\n= link_to 'Back', sections_path\n"
  },
  {
    "path": "app/views/sections/generate.html.haml",
    "content": "%div.container-fluid\n  %div.row\n    %div.col-lg-12\n      %div.col-lg-12{:style=>\" max-width:700px;\"}\n        %h3{:style => \"padding-left:3px;\"}\n          Generated Binary\n        %br\n\n        -device = nil\n\n        .well.well-lg{:style=>\" max-width:700px;\"}\n\n          %h5 Generation Configuration\n          - params.to_a.each do |p|\n            - if p[0].include? \"section\"\n              - sect_id = p[0].gsub(\"section_\",\"\")\n              - s = Section.find(sect_id)\n              - c = Capture.find(p[1])\n              - d = device = c.unit.device\n              %p{:style=>\" max-width:500px; word-wrap:break-word;\"}\n                %span= \"Section: \"\n                %span{:style=>\" color:white;\"}= \"#{s.name} \"\n                %span= \"(bits #{s.start_pos} to #{s.end_pos})\"\n                %span= \"from: \"\n                %span{:style=>\" color:white;\"}= \"#{c.unit.name}\" \n                %span= \" - \"\n                %span{:style=>\" color:white;\"}= \"#{c.name}\"\n                 \n          %br\n        .well.well-lg{:style=>\" max-width:700px;\"}\n          %h4 Original Format\n          %br\n          %h5 Binary \n          -bin = \"\"\n          -type = \"\"\n          - params.to_a.each do |p|\n            - if p[0].include? \"section\"\n              - sect_id = p[0].gsub(\"section_\",\"\")\n              - s = Section.find(sect_id)\n              - c = Capture.find(p[1])\n              - d = c.unit.device\n              - device = d\n              // CHECK MODULATION\n              - if d.could_be_pwm_7525?\n                - type = \"pwm7525\"\n                - b = c.pwm_decode_7525\n                - bin << b[s.start_pos..s.end_pos]\n              - elsif d.could_be_pwm?\n                - type = \"pwm\"\n                - b = c.pwm_decode\n                - bin << b[s.start_pos..s.end_pos]\n              - elsif d.could_be_manchester?\n                - type = \"manchester\"\n                - b = c.manchester_decode\n                - bin << b[s.start_pos..s.end_pos]\n              - else \n                - type = \"ook\"\n                - b = c.original_binary\n                - bin << b[s.start_pos..s.end_pos]\n          %p{:style=>\" max-width:500px; word-wrap:break-word;\"}=bin\n          %br\n          %span=\"Size: \"\n          %span= bin.size\n          %span=\"bits \"\n          %br\n          %br\n\n        .well.well-lg{:style=>\" max-width:700px;\"}\n          %h4  OOK Format \n          %br\n          %h5 Binary\n          - ook_bin = \"\"\n          // CHECK MODULATION\n          - if device.flip_pwm\n            - if type == \"pwm7525\"\n              -bin.scan(/./).each do |bit|\n                - ook_bin << \"1000\" if bit.to_s == '1'\n                - ook_bin << \"1110\" if bit.to_s == '0'\n            - elsif type == \"pwm\"\n              -bin.scan(/./).each do |bit|\n                - ook_bin << \"100\" if bit.to_s == '1'\n                - ook_bin << \"110\" if bit.to_s == '0'\n            - elsif type == \"manchester\"\n              -bin.scan(/./).each do |bit|\n                - ook_bin << \"01\" if bit.to_s == '1'\n                - ook_bin << \"10\" if bit.to_s == '0'\n            - elsif type == \"ook\"\n              -ook_bin << bin\n          - else\n            - if type == \"pwm7525\"\n              -bin.scan(/./).each do |bit|\n                - ook_bin << \"1110\" if bit.to_s == '1'\n                - ook_bin << \"1000\" if bit.to_s == '0'\n            - elsif type == \"pwm\"\n              -bin.scan(/./).each do |bit|\n                - ook_bin << \"110\" if bit.to_s == '1'\n                - ook_bin << \"100\" if bit.to_s == '0'\n            - elsif type == \"manchester\"\n              -bin.scan(/./).each do |bit|\n                - ook_bin << \"10\" if bit.to_s == '1'\n                - ook_bin << \"01\" if bit.to_s == '0'\n            - elsif type == \"ook\"\n              -ook_bin << bin\n\n\n\n\n          %p{:style=>\" max-width:500px; word-wrap:break-word;\"}= ook_bin\n          %br\n          %span=\"Size: \"\n          %span= ook_bin.size\n          %span=\"bits \"          \n\n\n          %br\n          %br\n          %hr\n          %h5 RFCat \n          =render \"rfcat_config\", device: device\n          %p{:style=>\" max-width:500px; word-wrap:break-word;\"}= \"d.RFxmit(\\\"#{Capture.to_hexcode ook_bin}\\\")\" \n          %br\n          %p=\"# or if you need to repeat the packet:\"\n          %p{:style=>\" max-width:500px; word-wrap:break-word;\"}= \"d.RFxmit(\\\"\\\\x00\\\\x00\\\\x00\\\\x00#{Capture.to_hexcode ook_bin}\\\" * 5)\" \n\n\n\n  %br\n\n\n\n\n-#Vertical text style for TH\n-#%th{:style => \"color:grey;-webkit-transform: rotate(-90deg);-moz-transform: rotate(-90deg);-ms-transform: rotate(-90deg);-o-transform: rotate(-90deg);filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);color: #FFF;text-transform: uppercase;\"} 0"
  },
  {
    "path": "app/views/sections/index.html.haml",
    "content": "%div.container-fluid\n  %div.row\n    %div.col-lg-12\n      %h3\n        Reverse Engineering Worksheet:\n        = @device.name\n      %p A Reverse Engineering Worksheet is built around the concept of sections. A section if portion of the binary that you define to have a particular meaning. E.g. if bits 0-7 represent the \"Device ID\" then you can define a section to reflect that. The worksheet the binary generates below is based on the modulation and encoding type saved for the device.\n      %br\n\n      %div.col-lg-8\n        %table.table.table-bordered\n          %tr\n            %th.bg-primary{style:\"width:15%;\"} Name\n            %td= @device.name\n          %tr\n            %th.bg-primary FCC ID\n            %td= @device.fcc_id\n          %tr\n            %th.bg-primary Modulation\n            %td\n              = @device.modulation\n          %tr\n            %th.bg-primary Encoding\n            %td= @device.encoding\n          %tr\n            %th.bg-primary Frequency\n            %td\n              = @device.frequency\n              = ' Mhz'\n          %tr\n            %th.bg-primary Baudrate\n            %td= @device.baudrate\n          %tr\n            %th.bg-primary Decoding Rules\n            %td= @device.flip_pwm == true ? \"Bits flipped after demodulation\" : \"Bits not flipped (Default State)\"\n          %tr\n            %th.bg-primary Notes\n            %td= @device.notes\n\n      %div.col-lg-3\n        .well.well-lg\n          %h5 Actions\n          = link_to 'Go Back to Device View', @device, :style => \"color:#2a9fd6;\"\n          %br\n          = link_to 'Edit Device', edit_device_path(@device), :style => \"color:#2a9fd6;\"\n\n    =render \"sections\", sections: @sections\n    =render \"no_sections\", sections: @sections, device: @device\n    =render \"pwm_analysis\", device: @device, without_baseline: @without_baseline\n    =render \"manchester_analysis\", device: @device, without_baseline: @without_baseline\n    =render \"raw_analysis\", device: @device, without_baseline: @without_baseline\n\n\n\n    %div.col-lg-12\n      %hr\n      %h4 Define new section\n\n      %p Pick and choose which capture to use as a template for each section and generate the binary. Note for this to work as intended, each bit you want to send should be included in a section definition.\n      %br\n\n      = render 'form'\n\n\n\n\n\n    %div.col-lg-12\n      %hr\n      %h4 Generate Binary \n\n      %p Pick and choose which captures to use as a template for each defined section and generate the binary for RFCat transmission. Note for this to work as intended, each bit in the table above should be included in a section definition or it won't be represented in the generated string.\n      %br\n\n      = form_tag(generate_path, method: \"post\") do \n        - @sections.each_with_index do |section|\n          .form-group\n            %label.col-lg-6.control-label{:for => \"colour\"}= \"#{section.name} from:\"\n            .col-lg-10\n              - captures = []\n              - @device.captures.each do |c|\n                - captures << [\"#{c.unit.name} - #{c.name}\",c.id]\n              - the_options = options_for_select(captures)\n              = select_tag \"section_#{section.id}\", the_options, label: false, input_html: { class: 'form-control' }\n              %br\n              %hr\n        .form-group\n          .col-lg-10.col-lg-offset-0\n            %button.btn.btn-primary{:type => \"submit\"} Generate Binary\n\n            %br\n            %br\n\n      =render \"section_transformations\", device: @device, captures: @device.units.map(&:captures).flatten, without_baseline: @without_baseline\n\n\n      - unless @sections.blank?\n        %div.col-lg-12.well.well-lg\n          %h4 Share these sections as a template\n          %p Reverse engineering something that doesn't exist in our template library? Please consider sharing your section template with us all once you've finished reverse engineering this device.\n          = simple_form_for(SectionTemplate.new(:added_by => \"anonymous\")) do |f|\n            = f.hidden_field :device_id, :value => @device.id\n            /-#%button.btn.btn-default{:type => \"reset\"} Cancel\n            %label.col-lg-10.control-label{:for => \"name\"} Template Name (please be descriptive, but concise. E.g. \"Generic Remote SC226x\")\n            .col-lg-10\n              = f.input :name, label: false, input_html: { class: 'form-control' }\n              %br\n            %label.col-lg-10.control-label{:for => \"added_by\"} Your Name or Handle (or leave this field unchanged and submit anonymously)\n            .col-lg-10\n              = f.input :added_by, label: false, input_html: { class: 'form-control' }\n              %br\n            .form-group\n              .col-lg-10.col-lg-offset-0\n                %button.btn.btn-primary{:type => \"submit\"} Share as Template\n\n  %br\n"
  },
  {
    "path": "app/views/sections/index.json.jbuilder",
    "content": "json.array!(@sections) do |section|\n  json.extract! section, :id, :device_id, :name, :notes, :start_pos, :end_pos, :colour\n  json.url section_url(section, format: :json)\nend\n"
  },
  {
    "path": "app/views/sections/new.html.haml",
    "content": "%h1 New section\n\n= render 'form'\n\n= link_to 'Back', sections_path\n"
  },
  {
    "path": "app/views/sections/show.html.haml",
    "content": "%p#notice= notice\n\n%p\n  %b Device:\n  = @section.device_id\n%p\n  %b Name:\n  = @section.name\n%p\n  %b Notes:\n  = @section.notes\n%p\n  %b Start pos:\n  = @section.start_pos\n%p\n  %b End pos:\n  = @section.end_pos\n%p\n  %b Colour:\n  = @section.colour\n\n= link_to 'Edit', edit_section_path(@section)\n\\|\n= link_to 'Back', sections_path\n\n\n\n%div.container-fluid\n  %div.row\n    %div.col-lg-12\n      %h3\n        Device:\n        = @device.name\n      %p A device is effectively a category. It should have at least one unit. If you have multiple units of the same type (e.g. 3 identical garage door remotes), they are best represented as multiple units of the same device.\n      %br\n\n      %div.col-lg-8\n        %table.table.table-bordered\n          %tr\n            %th.bg-primary{style:\"width:15%;\"} Name\n            %td= @device.name\n          %tr\n            %th.bg-primary FCC ID\n            %td= @device.fcc_id\n          %tr\n            %th.bg-primary Modulation\n            %td\n              = @device.modulation\n          %tr\n            %th.bg-primary Encoding\n            %td= @device.encoding\n          %tr\n            %th.bg-primary Frequency\n            %td\n              = @device.frequency\n              = ' Mhz'\n          %tr\n            %th.bg-primary Baudrate\n            %td= @device.baudrate\n          %tr\n            %th.bg-primary Notes\n            %td= @device.notes\n\n      %div.col-lg-3\n        .well.well-lg\n          %h5 Actions\n          -#= link_to 'Add New Unit', edit_device_path(@device), :style => \"color:#2a9fd6;\"\n          -#%br\n          =link_to 'Edit Device', edit_device_path(@device), :style => \"color:#2a9fd6;\"\n          %br\n          = link_to 'Back to Devices', devices_path, :style => \"color:#2a9fd6;\"\n\n\n\n    =render \"manchester_analysis\", device: @device, without_baseline: @without_baseline\n\n\n    / =render \"manchester_analysis\", unit: @unit\n    =render \"pwm_analysis\", device: @device, without_baseline: @without_baseline\n    / =render \"raw_analysis\", unit: @unit\n\n    / # change raw so only shows if no encoding\n    =render \"raw_analysis\", device: @device, without_baseline: @without_baseline\n\n    / # replace with section add ??????\n    =render \"add_unit\", unit: @unit\n    =render \"show_units\", device: @device\n\n\n\n  %br\n\n-#Vertical text style for TH\n-#%th{:style => \"color:grey;-webkit-transform: rotate(-90deg);-moz-transform: rotate(-90deg);-ms-transform: rotate(-90deg);-o-transform: rotate(-90deg);filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);color: #FFF;text-transform: uppercase;\"} 0"
  },
  {
    "path": "app/views/sections/show.json.jbuilder",
    "content": "json.extract! @section, :id, :device_id, :name, :notes, :start_pos, :end_pos, :colour, :created_at, :updated_at\n"
  },
  {
    "path": "app/views/units/_captures.html.haml",
    "content": "%h4 Captures\n%table.table.table-bordered.table.hover\n  %thead\n    %tr.bg-primary\n      %th ID\n      %th Name\n      %th Raw Binary\n      %th Actions\n  %tbody\n    - unit.captures.each do |u|\n      %tr\n        %td= u.id\n        %td= u.name\n\n        %td{:style=>\"max-width:200px; word-wrap:break-word;\"}\n          / - u.original_binary.scan(/.{1,40}/).each do |s|\n          /   =\"#{s}\"\n          /   %br\n          = u.original_binary\n        %td{:style => \"width:15%;\"}\n          = link_to 'Destroy', u, :method => :delete, :data => { :confirm => 'Are you sure?' }\n          %div.col-lg-12"
  },
  {
    "path": "app/views/units/_form.html.haml",
    "content": "= simple_form_for(@unit) do |f|\n  = f.error_notification\n\n  = f.hidden_field :device_id\n\n  .form-group\n    %label.col-lg-2.control-label{:for => \"inputEmail\"} Name\n    .col-lg-10\n      = f.input :name, label: false, input_html: { class: 'form-control' }\n      %br\n\n\n  .form-group\n    .col-lg-10.col-lg-offset-2\n      /-#%button.btn.btn-default{:type => \"reset\"} Cancel\n      %button.btn.btn-primary{:type => \"submit\"} Submit"
  },
  {
    "path": "app/views/units/_manchester_analysis.html.haml",
    "content": "- if unit.captures.present?\n  - if unit.device.could_be_manchester?\n    %div.col-lg-12\n      %hr\n      %h4 Manchester Bit Position Analysis Tool\n\n      %p The longest binary string is used as the comparison baseline (B) below\n      %br\n      / -`inspectrum`\n\n      %table.table.table-hover.table-bordered{style:'background-color:black;'}\n        - x1 = unit.captures.each\n        - x = x1.sort_by {|y|y.manchester_decode.scan(/\\w/).count}\n        - baseline = x.last.manchester_decode.scan(/\\w/)\n        - x.each do |xx|\n          - diff = baseline.count - xx.manchester_decode.scan(/\\w/).count\n          - if diff > 0\n            - diff.times do |i|\n              - xx.binary = xx.manchester_decode << 'p'\n        %thead\n          %tr\n            %th\n            -baseline.flatten.each_with_index do |it,index|\n              %th{:style => \"color:grey;\"}= index\n        %tbody\n\n          - x.each do |barray|\n            %tr\n              %td\n                = barray.name\n              - barray.manchester_decode.scan(/\\w/).each_with_index do |b, index|\n                - if b == baseline[index]\n                  - if b != 'p'\n                    %td.text-success= b\n                  - else\n                    %td\n                -else\n                  - if b != 'p'\n                    %td.text-danger= b\n                  - else\n                    %td\n          %td{style:\"text-align:center;\"} B\n          -baseline.each do |b|\n            - if b != 'p'\n              %td.text-primary= b\n            - else\n              %td\n\n      %br"
  },
  {
    "path": "app/views/units/_manchester_decoding.html.haml",
    "content": "%h5 Manchester Encoding\n- if manchester_format.blank?\n  %span{:style => \"float:right;\"}= link_to \"Switch to IEEE 802 Format\", '?manchester_format=802', style:\"color:#2a9fd6\"\n  %p Defaulting to Manchester format: \"G. E. Thomas\"\n- else\n  %span{:style => \"float:right;\"}= link_to \"Switch to G. E. Thomas Format\", '?', style:\"color:#2a9fd6\"\n  %p Showing as Manchester format: \"IEE 802\"\n\n%table.table.table-bordered.table.hover\n  %thead\n    %tr.bg-primary\n      %th ID\n      %th Name\n      %th Valid?\n      %th Manchester Binary\n      %th Hex\n      %th Ascii\n      %th Actions\n  %tbody\n    - unit.captures.each do |u|\n      %tr\n        %td= u.id\n        %td= u.name\n        %td{:style=>\"word-wrap:break-word;\"}\n          - if u.valid_manchester?\n            %p{:style => \"color:green;\"}= \"#{u.valid_manchester? human=true}\"\n          - else\n            %p{:style => \"color:red;\"}= \"#{u.valid_manchester? human=true}\"\n        %td\n          - manchester = (manchester_format.blank? ? manchester = u.manchester_decode : u.flip(u.manchester_decode))\n          - manchester.scan(/.{1,40}/).each do |s|\n            =\"#{s}\"\n            %br\n        %td{:style=>\"word-wrap:break-word;\"}=\"#{u.to_hexcode manchester}\"\n        %td{:style=>\"word-wrap:break-word;\"}=\"#{u.bin_to_ascii(manchester)}\"\n\n        %td{:style => \"width:15%;\"}\n          = link_to 'show', u\n          \\|\n          = link_to 'Destroy', u, :method => :delete, :data => { :confirm => 'Are you sure?' }"
  },
  {
    "path": "app/views/units/_pwm_analysis.html.haml",
    "content": "- if unit.captures.present?\n  - if unit.device.could_be_pwm?\n    %div.col-lg-12\n      %hr\n      %h4 PWM Bit Position Analysis Tool (66/33)\n\n      %p The longest binary string is used as the comparison baseline (B) below\n      %br\n      / -`inspectrum`\n\n      %table.table.table-hover.table-bordered{style:'background-color:black;'}\n        - x1 = unit.captures.each\n        - x = x1.sort_by {|y|y.pwm_decode.scan(/\\w/).count}\n        - baseline = x.last.pwm_decode.scan(/\\w/)\n        - x.each do |xx|\n          - diff = baseline.count - xx.pwm_decode.scan(/\\w/).count\n          - if diff > 0\n            - diff.times do |i|\n              - xx.binary = xx.pwm_decode << 'p'\n        %thead\n          %tr\n            %th\n            -baseline.flatten.each_with_index do |it,index|\n              %th{:style => \"color:grey;\"}= index\n        %tbody\n\n          - x.each do |barray|\n            %tr\n              %td\n                = barray.name\n              - barray.pwm_decode.scan(/\\w/).each_with_index do |b, index|\n                - if b == baseline[index]\n                  - if b != 'p'\n                    %td.text-success= b\n                  - else\n                    %td\n                -else\n                  - if b != 'p'\n                    %td.text-danger= b\n                  - else\n                    %td\n          %td{style:\"text-align:center;\"} B\n          -baseline.each do |b|\n            - if b != 'p'\n              %td.text-primary= b\n            - else\n              %td\n\n      %br\n\n\n  - if unit.device.could_be_pwm_7525?\n    %div.col-lg-12\n      %hr\n      %h4 PWM Bit Position Analysis Tool (75/25)\n\n      %p The longest binary string is used as the comparison baseline (B) below\n      %br\n      / -`inspectrum`\n\n      %table.table.table-hover.table-bordered{style:'background-color:black;'}\n        - x1 = unit.captures.each\n        - x = x1.sort_by {|y|y.pwm_decode_7525.scan(/\\w/).count}\n        - baseline = x.last.pwm_decode_7525.scan(/\\w/)\n        - x.each do |xx|\n          - diff = baseline.count - xx.pwm_decode_7525.scan(/\\w/).count\n          - if diff > 0\n            - diff.times do |i|\n              - xx.binary = xx.pwm_decode_7525 << 'p'\n        %thead\n          %tr\n            %th\n            -baseline.flatten.each_with_index do |it,index|\n              %th{:style => \"color:grey;\"}= index\n        %tbody\n\n          - x.each do |barray|\n            %tr\n              %td\n                = barray.name\n              - barray.pwm_decode_7525.scan(/\\w/).each_with_index do |b, index|\n                - if b == baseline[index]\n                  - if b != 'p'\n                    %td.text-success= b\n                  - else\n                    %td\n                -else\n                  - if b != 'p'\n                    %td.text-danger= b\n                  - else\n                    %td\n          %td{style:\"text-align:center;\"} B\n          -baseline.each do |b|\n            - if b != 'p'\n              %td.text-primary= b\n            - else\n              %td\n\n      %br\n\n"
  },
  {
    "path": "app/views/units/_pwm_decoding.html.haml",
    "content": "%h5 PWM Encoding\n- if pwm_format.blank?\n  %span{:style => \"float:right;\"}= link_to \"Flip bits\", '?pwm_format=flipped', style:\"color:#2a9fd6\"\n  %p Attempts to decode as PWM 66/33 Format (i.e. a 1 is 110, and a 0 is 100)\n- else\n  %span{:style => \"float:right;\"}= link_to \"Undo flip bits\", '?', style:\"color:#2a9fd6\"\n  %p Attempts to decode as PWM 66/33 Format, with bits flipped (i.e. a 1 is 100, and a 0 is 110)\n%table.table.table-bordered.table.hover\n  %thead\n    %tr.bg-primary\n      %th ID\n      %th Name\n      %th Valid?\n      %th PWM Binary\n      %th Hex\n      %th Ascii\n      %th Actions\n  %tbody\n    - unit.captures.each do |u|\n      %tr\n        %td= u.id\n        %td= u.name\n        %td\n          - if u.valid_pwm?\n            %p{:style => \"color:green;\"}= \"#{u.valid_pwm? human=true}\"\n          - else\n            %p{:style => \"color:red;\"}= \"#{u.valid_pwm? human=true}\"\n        %td{:style=>\"word-wrap:break-word;\"}\n          - pwm = (pwm_format.blank? ?  u.pwm_decode : u.flip(u.pwm_decode))\n          - pwm.scan(/.{1,40}/).each do |s|\n            =\"#{s}\"\n            %br\n        %td{:style=>\"word-wrap:break-word;\"}=\"#{u.to_hexcode pwm}\"\n        %td{:style=>\"word-wrap:break-word;\"}=\"#{u.bin_to_ascii(pwm)}\"\n\n        %td{:style => \"width:15%;\"}\n          = link_to 'show', u\n          \\|\n          = link_to 'Destroy', u, :method => :delete, :data => { :confirm => 'Are you sure?' }\n\n\n\n/ # 75/25\n\n%h5 PWM Encoding\n- if pwm_format.blank?\n  %span{:style => \"float:right;\"}= link_to \"Flip bits\", '?pwm_format=flipped', style:\"color:#2a9fd6\"\n  %p Attempts to decode as PWM 75/25 Format (i.e. a 1 is 1110, and a 0 is 1000)\n- else\n  %span{:style => \"float:right;\"}= link_to \"Undo flip bits\", '?', style:\"color:#2a9fd6\"\n  %p Attempts to decode as PWM 75/25 Format, with bits flipped (i.e. a 1 is 1000, and a 0 is 1110)\n%table.table.table-bordered.table.hover\n  %thead\n    %tr.bg-primary\n      %th ID\n      %th Name\n      %th Valid?\n      %th PWM Binary\n      %th Hex\n      %th Ascii\n      %th Actions\n  %tbody\n    - unit.captures.each do |u|\n      %tr\n        %td= u.id\n        %td= u.name\n        %td\n          - if u.valid_pwm_7525?\n            %p{:style => \"color:green;\"}= \"#{u.valid_pwm_7525? human=true}\"\n          - else\n            %p{:style => \"color:red;\"}= \"#{u.valid_pwm_7525? human=true}\"\n        %td{:style=>\"word-wrap:break-word;\"}\n          - pwm = (pwm_format.blank? ?  u.pwm_decode_7525 : u.flip(u.pwm_decode_7525))\n          \n          - pwm.scan(/.{1,40}/).each do |s|\n            =\"#{s}\"\n            %br\n        %td{:style=>\"word-wrap:break-word;\"}=\"#{u.to_hexcode pwm}\"\n        %td{:style=>\"word-wrap:break-word;\"}=\"#{u.bin_to_ascii(pwm)}\"\n\n        %td{:style => \"width:15%;\"}\n          = link_to 'show', u\n          \\|\n          = link_to 'Destroy', u, :method => :delete, :data => { :confirm => 'Are you sure?' }\n\n\n\n"
  },
  {
    "path": "app/views/units/_raw_analysis.html.haml",
    "content": "- if unit.captures.present?\n  %div.col-lg-12\n    %hr\n    %h4 Raw Bit Position Analysis Tool\n\n    %p The longest binary string is used as the comparison baseline (B) below\n    %br\n    / -`inspectrum`\n\n    %table.table.table-hover.table-bordered{style:'background-color:black;'}\n      - x1 = unit.captures.each\n      - x = x1.sort_by {|y|y.original_binary.scan(/\\w/).count}\n      - baseline = x.last.original_binary.scan(/\\w/)\n      - x.each do |xx|\n        - diff = baseline.count - xx.original_binary.scan(/\\w/).count\n        - xx.binary = xx.original_binary\n        - if diff > 0\n          - diff.times do |i|\n            - xx.binary = xx.binary << 'p'\n      %thead\n        %tr\n          %th\n          -baseline.flatten.each_with_index do |it,index|\n            %th{:style => \"color:grey;\"}= index\n      %tbody\n\n        - x.each do |barray|\n          %tr\n            %td\n              = barray.name\n            - barray.binary.scan(/\\w/).each_with_index do |b, index|\n              - if b == baseline[index]\n                - if b != 'p'\n                  %td.text-success= b\n                - else\n                  %td\n              -else\n                - if b != 'p'\n                  %td.text-danger= b\n                - else\n                  %td\n        %td{style:\"text-align:center;\"} B\n        -baseline.each do |b|\n          - if b != 'p'\n            %td.text-primary= b\n          - else\n            %td\n\n    %br\n"
  },
  {
    "path": "app/views/units/_raw_decoding.html.haml",
    "content": "%h5 Raw (No special encoding)\n\n%table.table.table-bordered.table.hover\n  %thead\n    %tr.bg-primary\n      %th ID\n      %th Name\n      %th Raw Binary To Hex\n      %th Raw Binary To Ascii\n      %th Actions\n  %tbody\n    - unit.captures.each do |u|\n      %tr\n        %td= u.id\n        %td= u.name\n        %td{:style=>\"word-wrap:break-word;\"}=\"#{u.to_hexcode }\"\n        %td{:style=>\"word-wrap:break-word;\"}=\"#{u.to_ascii(manchester=false)}\"\n        %td{:style => \"width:15%;\"}\n          = link_to 'show', u\n          \\|\n          = link_to 'Destroy', u, :method => :delete, :data => { :confirm => 'Are you sure?' }\n\n"
  },
  {
    "path": "app/views/units/edit.html.haml",
    "content": "%h1 Editing unit\n\n= render 'form'\n\n= link_to 'Show', @unit\n\\|\n= link_to 'Back', units_path\n"
  },
  {
    "path": "app/views/units/index.html.haml",
    "content": "%h1 Listing units\n\n%table\n  %thead\n    %tr\n      %th Device\n      %th Name\n      %th Notes\n      %th\n      %th\n      %th\n\n  %tbody\n    - @units.each do |unit|\n      %tr\n        %td= unit.device_id\n        %td= unit.name\n        %td= unit.notes\n        %td= link_to 'Show', unit\n        %td= link_to 'Edit', edit_unit_path(unit)\n        %td= link_to 'Destroy', unit, :method => :delete, :data => { :confirm => 'Are you sure?' }\n\n%br\n\n= link_to 'New Unit', new_unit_path\n"
  },
  {
    "path": "app/views/units/index.json.jbuilder",
    "content": "json.array!(@units) do |unit|\n  json.extract! unit, :id, :device_id, :name, :notes\n  json.url unit_url(unit, format: :json)\nend\n"
  },
  {
    "path": "app/views/units/new.html.haml",
    "content": "%h1 New unit\n\n= render 'form'\n\n= link_to 'Back', units_path\n"
  },
  {
    "path": "app/views/units/show.html.haml",
    "content": "%div.container-fluid\n  %div.row\n    %div.col-lg-12\n      %h3\n        Unit:\n        = @unit.name\n      %p\n        This unit is a\n        = link_to @unit.device.name, @unit.device, style:\"color:#2a9fd6\"\n      %br\n\n      %div.col-lg-8\n        %table.table.table-bordered\n          %tr\n            %th.bg-primary{style:\"width:25%;\"} Name\n            %td= @unit.name\n          %tr\n            %th.bg-primary Device ID\n            %td= @unit.device.id\n          %tr\n            %th.bg-primary Device Name\n            %td\n              = @unit.device.name\n          %tr\n            %th.bg-primary Notes\n            %td= @unit.notes\n\n\n\n      %div.col-lg-3\n        .well.well-lg\n          %h5 Actions\n          = link_to 'Add New Capture' , new_device_unit_capture_path(@unit.device.id, @unit.id), style:\"color:#2a9fd6\"\n          %br\n          = link_to 'Edit Unit', edit_unit_path(@unit), style:\"color:#2a9fd6\"\n          %br\n          = link_to 'View Device', @unit.device, style:\"color:#2a9fd6\"\n\n\n\n      %div.col-lg-12\n        %hr\n        =render \"captures\", unit: @unit\n\n\n        %hr\n        %h4 Automated Demodulation Attempts\n        %br\n\n        =render \"raw_decoding\", unit: @unit\n        =render \"manchester_decoding\", unit: @unit, manchester_format: @manchester_format\n        =render \"pwm_decoding\", unit: @unit, pwm_format: @pwm_format\n\n        =render \"manchester_analysis\", unit: @unit\n        =render \"pwm_analysis\", unit: @unit\n        =render \"raw_analysis\", unit: @unit\n\n\n\n\n  = simple_form_for(@unit) do |f|\n    = f.error_notification\n    .form-group\n      %label.col-lg-2.control-label{:for => \"notes\"} Notes\n      .col-lg-10\n        = f.input :notes, label: false, type: 'text-area', input_html: { class: 'form-control textArea', rows: 10 }\n      %br\n      .form-group\n        .col-lg-10.col-lg-offset-2\n          /-#%button.btn.btn-default{:type => \"reset\"} Cancel\n          %button.btn.btn-primary{:type => \"submit\"} Update\n"
  },
  {
    "path": "app/views/units/show.json.jbuilder",
    "content": "json.extract! @unit, :id, :device_id, :name, :notes, :created_at, :updated_at\n"
  },
  {
    "path": "bin/bundle",
    "content": "#!/usr/bin/env ruby\nENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)\nload Gem.bin_path('bundler', 'bundle')\n"
  },
  {
    "path": "bin/rails",
    "content": "#!/usr/bin/env ruby\nAPP_PATH = File.expand_path('../../config/application', __FILE__)\nrequire_relative '../config/boot'\nrequire 'rails/commands'\n"
  },
  {
    "path": "bin/rake",
    "content": "#!/usr/bin/env ruby\nrequire_relative '../config/boot'\nrequire 'rake'\nRake.application.run\n"
  },
  {
    "path": "bin/setup",
    "content": "#!/usr/bin/env ruby\nrequire 'pathname'\n\n# path to your application root.\nAPP_ROOT = Pathname.new File.expand_path('../../',  __FILE__)\n\nDir.chdir APP_ROOT do\n  # This script is a starting point to setup your application.\n  # Add necessary setup steps to this file:\n\n  puts \"== Installing dependencies ==\"\n  system \"gem install bundler --conservative\"\n  system \"bundle check || bundle install\"\n\n  # puts \"\\n== Copying sample files ==\"\n  # unless File.exist?(\"config/database.yml\")\n  #   system \"cp config/database.yml.sample config/database.yml\"\n  # end\n\n  puts \"\\n== Preparing database ==\"\n  system \"bin/rake db:setup\"\n\n  puts \"\\n== Removing old logs and tempfiles ==\"\n  system \"rm -f log/*\"\n  system \"rm -rf tmp/cache\"\n\n  puts \"\\n== Restarting application server ==\"\n  system \"touch tmp/restart.txt\"\nend\n"
  },
  {
    "path": "config/application.rb",
    "content": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :production.\nBundler.require(*Rails.groups)\n\nmodule DspectrumGUI\n  class Application < Rails::Application\n    # Settings in config/environments/* take precedence over those specified here.\n    # Application configuration should go into files in config/initializers\n    # -- all .rb files in that directory are automatically loaded.\n\n    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.\n    # Run \"rake -D time\" for a list of tasks for finding time zone names. Default is UTC.\n    # config.time_zone = 'Central Time (US & Canada)'\n\n    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.\n    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]\n    # config.i18n.default_locale = :de\n\n    # Do not swallow errors in after_commit/after_rollback callbacks.\n    config.active_record.raise_in_transactional_callbacks = true\n    config.assets.paths << Rails.root.join('app', 'assets', 'fonts')\n\n  end\nend\n"
  },
  {
    "path": "config/boot.rb",
    "content": "ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)\n\nrequire 'bundler/setup' # Set up gems listed in the Gemfile.\n"
  },
  {
    "path": "config/database.yml",
    "content": "# SQLite version 3.x\n#   gem install sqlite3\n#\n#   Ensure the SQLite 3 gem is defined in your Gemfile\n#   gem 'sqlite3'\n#\ndefault: &default\n  adapter: sqlite3\n  pool: 5\n  timeout: 5000\n\ndevelopment:\n  <<: *default\n  database: db/development.sqlite3\n\n# Warning: The database defined as \"test\" will be erased and\n# re-generated from your development database when you run \"rake\".\n# Do not set this db to the same as development or production.\ntest:\n  <<: *default\n  database: db/test.sqlite3\n\nproduction:\n  <<: *default\n  database: db/production.sqlite3\n"
  },
  {
    "path": "config/environment.rb",
    "content": "# Load the Rails application.\nrequire File.expand_path('../application', __FILE__)\n\n# Initialize the Rails application.\nRails.application.initialize!\n"
  },
  {
    "path": "config/environments/development.rb",
    "content": "Rails.application.configure do\n  # Settings specified here will take precedence over those in config/application.rb.\n\n  # In the development environment your application's code is reloaded on\n  # every request. This slows down response time but is perfect for development\n  # since you don't have to restart the web server when you make code changes.\n  config.cache_classes = false\n\n  # Do not eager load code on boot.\n  config.eager_load = false\n\n  # Show full error reports and disable caching.\n  config.consider_all_requests_local       = true\n  config.action_controller.perform_caching = false\n\n  # Don't care if the mailer can't send.\n  config.action_mailer.raise_delivery_errors = false\n\n  # Print deprecation notices to the Rails logger.\n  config.active_support.deprecation = :log\n\n  # Raise an error on page load if there are pending migrations.\n  config.active_record.migration_error = :page_load\n\n  # Debug mode disables concatenation and preprocessing of assets.\n  # This option may cause significant delays in view rendering with a large\n  # number of complex assets.\n  config.assets.debug = true\n\n  # Asset digests allow you to set far-future HTTP expiration dates on all assets,\n  # yet still be able to expire them through the digest params.\n  config.assets.digest = true\n\n  # Adds additional error checking when serving assets at runtime.\n  # Checks for improperly declared sprockets dependencies.\n  # Raises helpful error messages.\n  config.assets.raise_runtime_errors = true\n\n  # Raises error for missing translations\n  # config.action_view.raise_on_missing_translations = true\n  config.assets.paths << Rails.root.join('app', 'assets', 'fonts')\n\nend\n"
  },
  {
    "path": "config/environments/production.rb",
    "content": "Rails.application.configure do\n  # Settings specified here will take precedence over those in config/application.rb.\n\n  # Code is not reloaded between requests.\n  config.cache_classes = true\n\n  # Eager load code on boot. This eager loads most of Rails and\n  # your application in memory, allowing both threaded web servers\n  # and those relying on copy on write to perform better.\n  # Rake tasks automatically ignore this option for performance.\n  config.eager_load = true\n\n  # Full error reports are disabled and caching is turned on.\n  config.consider_all_requests_local       = false\n  config.action_controller.perform_caching = true\n\n  # Enable Rack::Cache to put a simple HTTP cache in front of your application\n  # Add `rack-cache` to your Gemfile before enabling this.\n  # For large-scale production use, consider using a caching reverse proxy like\n  # NGINX, varnish or squid.\n  # config.action_dispatch.rack_cache = true\n\n  # Disable serving static files from the `/public` folder by default since\n  # Apache or NGINX already handles this.\n  config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?\n\n  # Compress JavaScripts and CSS.\n  config.assets.js_compressor = :uglifier\n  # config.assets.css_compressor = :sass\n\n  # Do not fallback to assets pipeline if a precompiled asset is missed.\n  config.assets.compile = false\n\n  # Asset digests allow you to set far-future HTTP expiration dates on all assets,\n  # yet still be able to expire them through the digest params.\n  config.assets.digest = true\n\n  # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb\n\n  # Specifies the header that your server uses for sending files.\n  # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache\n  # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX\n\n  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.\n  config.force_ssl = true\n\n  # Use the lowest log level to ensure availability of diagnostic information\n  # when problems arise.\n  config.log_level = :debug\n\n  # Prepend all log lines with the following tags.\n  # config.log_tags = [ :subdomain, :uuid ]\n\n  # Use a different logger for distributed setups.\n  # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)\n\n  # Use a different cache store in production.\n  # config.cache_store = :mem_cache_store\n\n  # Enable serving of images, stylesheets, and JavaScripts from an asset server.\n  # config.action_controller.asset_host = 'http://assets.example.com'\n\n  # Ignore bad email addresses and do not raise email delivery errors.\n  # Set this to true and configure the email server for immediate delivery to raise delivery errors.\n  # config.action_mailer.raise_delivery_errors = false\n\n  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to\n  # the I18n.default_locale when a translation cannot be found).\n  config.i18n.fallbacks = true\n\n  # Send deprecation notices to registered listeners.\n  config.active_support.deprecation = :notify\n\n  # Use default logging formatter so that PID and timestamp are not suppressed.\n  config.log_formatter = ::Logger::Formatter.new\n\n  # Do not dump schema after migrations.\n  config.active_record.dump_schema_after_migration = false\n\n  config.assets.paths << Rails.root.join('app', 'assets', 'fonts')\n\nend\n"
  },
  {
    "path": "config/environments/test.rb",
    "content": "Rails.application.configure do\n  # Settings specified here will take precedence over those in config/application.rb.\n\n  # The test environment is used exclusively to run your application's\n  # test suite. You never need to work with it otherwise. Remember that\n  # your test database is \"scratch space\" for the test suite and is wiped\n  # and recreated between test runs. Don't rely on the data there!\n  config.cache_classes = true\n\n  # Do not eager load code on boot. This avoids loading your whole application\n  # just for the purpose of running a single test. If you are using a tool that\n  # preloads Rails for running tests, you may have to set it to true.\n  config.eager_load = false\n\n  # Configure static file server for tests with Cache-Control for performance.\n  config.serve_static_files   = true\n  config.static_cache_control = 'public, max-age=3600'\n\n  # Show full error reports and disable caching.\n  config.consider_all_requests_local       = true\n  config.action_controller.perform_caching = false\n\n  # Raise exceptions instead of rendering exception templates.\n  config.action_dispatch.show_exceptions = false\n\n  # Disable request forgery protection in test environment.\n  config.action_controller.allow_forgery_protection = false\n\n  # Tell Action Mailer not to deliver emails to the real world.\n  # The :test delivery method accumulates sent emails in the\n  # ActionMailer::Base.deliveries array.\n  config.action_mailer.delivery_method = :test\n\n  # Randomize the order test cases are executed.\n  config.active_support.test_order = :random\n\n  # Print deprecation notices to the stderr.\n  config.active_support.deprecation = :stderr\n\n  # Raises error for missing translations\n  # config.action_view.raise_on_missing_translations = true\nend\n"
  },
  {
    "path": "config/favicon.json",
    "content": "{\n    \"master_picture\": \"public/adb.png\",\n    \"favicon_design\": {\n        \"ios\": {\n            \"picture_aspect\": \"no_change\"\n        },\n        \"desktop_browser\": [\n\n        ],\n        \"windows\": {\n            \"picture_aspect\": \"no_change\",\n            \"background_color\": \"#da532c\",\n            \"on_conflict\": \"override\"\n        },\n        \"android_chrome\": {\n            \"picture_aspect\": \"no_change\",\n            \"theme_color\": \"#ffffff\",\n            \"manifest\": {\n                \"name\": \"AdvisoryDB\",\n                \"display\": \"browser\",\n                \"orientation\": \"not_set\",\n                \"on_conflict\": \"override\",\n                \"declared\": true\n            }\n        },\n        \"safari_pinned_tab\": {\n            \"picture_aspect\": \"black_and_white\",\n            \"threshold\": 50,\n            \"theme_color\": \"#5bbad5\"\n        }\n    },\n    \"settings\": {\n        \"scaling_algorithm\": \"Mitchell\",\n        \"error_on_image_too_small\": false\n    }\n}\n"
  },
  {
    "path": "config/initializers/action_mailer.rb",
    "content": "# Be sure to restart your server when you modify this file.\n# /config/initializers/action_mailer.rb..\n\n# ActionMailer email configuration\nActionMailer::Base.delivery_method = :smtp\nActionMailer::Base.smtp_settings = {\n  :address              => \"smtp.zoho.com\", #ENV['SMTP_ADDRESS'],\n  :port                 => 465, # ENV['SMTP_PORT'],\n  :domain               => Rails.env == 'production' ? \"advisorydb.com\" : \"localhost\", # ENV['SMTP_DOMAIN'],\n  :user_name            => \"do-not-reply@advisorydb.com\", #ENV['SMTP_USERNAME'],\n  :password             => \"ActionMailer!\", #ENV['SMTP_PASSWORD'],\n  :authentication       => :login,\n  :enable_starttls_auto => true,\n  :ssl \t\t\t\t\t=> true\n}\n"
  },
  {
    "path": "config/initializers/assets.rb",
    "content": "\n# Be sure to restart your server when you modify this file.\n\n# Version of your assets, change this if you want to expire all your assets.\nRails.application.config.assets.version = '1.0'\n\n# Add additional assets to the asset load path\n# Rails.application.config.assets.paths << Emoji.images_path\n\n# Precompile additional assets.\n# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.\n# Rails.application.config.assets.precompile += %w( search.js )\nRails.application.config.assets.precompile += %w( bootstrap.min.js )\nRails.application.config.assets.precompile += %w( favicon/.* )"
  },
  {
    "path": "config/initializers/backtrace_silencers.rb",
    "content": "# Be sure to restart your server when you modify this file.\n\n# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.\n# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }\n\n# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.\n# Rails.backtrace_cleaner.remove_silencers!\n"
  },
  {
    "path": "config/initializers/cookies_serializer.rb",
    "content": "# Be sure to restart your server when you modify this file.\n\nRails.application.config.action_dispatch.cookies_serializer = :json\n"
  },
  {
    "path": "config/initializers/devise.rb",
    "content": "# Use this hook to configure devise mailer, warden hooks and so forth.\n# Many of these configuration options can be set straight in your model.\nDevise.setup do |config|\n  # The secret key used by Devise. Devise uses this key to generate\n  # random tokens. Changing this key will render invalid all existing\n  # confirmation, reset password and unlock tokens in the database.\n  # Devise will use the `secret_key_base` on Rails 4+ applications as its `secret_key`\n  # by default. You can change it below and use your own secret key.\n  # config.secret_key = '27ff1e4ffa3ec01fac4d388cd37ea67780a1fbbd936d7e9ba30ba89f289f55ef8a6914dd77b4ef0e60c2b9365c89950f5ae6d45c058c25da2c7977d2d736d49f'\n\n  # ==> Mailer Configuration\n  # Configure the e-mail address which will be shown in Devise::Mailer,\n  # note that it will be overwritten if you use your own mailer class\n  # with default \"from\" parameter.\n  config.mailer_sender = 'do-not-reply@advisorydb.com'\n\n  # Configure the class responsible to send e-mails.\n  # config.mailer = 'Devise::Mailer'\n\n  # ==> ORM configuration\n  # Load and configure the ORM. Supports :active_record (default) and\n  # :mongoid (bson_ext recommended) by default. Other ORMs may be\n  # available as additional gems.\n  require 'devise/orm/active_record'\n\n  # ==> Configuration for any authentication mechanism\n  # Configure which keys are used when authenticating a user. The default is\n  # just :email. You can configure it to use [:username, :subdomain], so for\n  # authenticating a user, both parameters are required. Remember that those\n  # parameters are used only when authenticating and not when retrieving from\n  # session. If you need permissions, you should implement that in a before filter.\n  # You can also supply a hash where the value is a boolean determining whether\n  # or not authentication should be aborted when the value is not present.\n  # config.authentication_keys = [:email]\n\n  # Configure parameters from the request object used for authentication. Each entry\n  # given should be a request method and it will automatically be passed to the\n  # find_for_authentication method and considered in your model lookup. For instance,\n  # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.\n  # The same considerations mentioned for authentication_keys also apply to request_keys.\n  # config.request_keys = []\n\n  # Configure which authentication keys should be case-insensitive.\n  # These keys will be downcased upon creating or modifying a user and when used\n  # to authenticate or find a user. Default is :email.\n  config.case_insensitive_keys = [:email]\n\n  # Configure which authentication keys should have whitespace stripped.\n  # These keys will have whitespace before and after removed upon creating or\n  # modifying a user and when used to authenticate or find a user. Default is :email.\n  config.strip_whitespace_keys = [:email]\n\n  # Tell if authentication through request.params is enabled. True by default.\n  # It can be set to an array that will enable params authentication only for the\n  # given strategies, for example, `config.params_authenticatable = [:database]` will\n  # enable it only for database (email + password) authentication.\n  # config.params_authenticatable = true\n\n  # Tell if authentication through HTTP Auth is enabled. False by default.\n  # It can be set to an array that will enable http authentication only for the\n  # given strategies, for example, `config.http_authenticatable = [:database]` will\n  # enable it only for database authentication. The supported strategies are:\n  # :database      = Support basic authentication with authentication key + password\n  # config.http_authenticatable = false\n\n  # If 401 status code should be returned for AJAX requests. True by default.\n  # config.http_authenticatable_on_xhr = true\n\n  # The realm used in Http Basic Authentication. 'Application' by default.\n  # config.http_authentication_realm = 'Application'\n\n  # It will change confirmation, password recovery and other workflows\n  # to behave the same regardless if the e-mail provided was right or wrong.\n  # Does not affect registerable.\n  # config.paranoid = true\n\n  # By default Devise will store the user in session. You can skip storage for\n  # particular strategies by setting this option.\n  # Notice that if you are skipping storage for all authentication paths, you\n  # may want to disable generating routes to Devise's sessions controller by\n  # passing skip: :sessions to `devise_for` in your config/routes.rb\n  config.skip_session_storage = [:http_auth]\n\n  # By default, Devise cleans up the CSRF token on authentication to\n  # avoid CSRF token fixation attacks. This means that, when using AJAX\n  # requests for sign in and sign up, you need to get a new CSRF token\n  # from the server. You can disable this option at your own risk.\n  # config.clean_up_csrf_token_on_authentication = true\n\n  # ==> Configuration for :database_authenticatable\n  # For bcrypt, this is the cost for hashing the password and defaults to 10. If\n  # using other encryptors, it sets how many times you want the password re-encrypted.\n  #\n  # Limiting the stretches to just one in testing will increase the performance of\n  # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use\n  # a value less than 10 in other environments. Note that, for bcrypt (the default\n  # encryptor), the cost increases exponentially with the number of stretches (e.g.\n  # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).\n  config.stretches = Rails.env.test? ? 1 : 10\n\n  # Setup a pepper to generate the encrypted password.\n  # config.pepper = '675698e6390c4de3dab1e89dda134d42b1b0a840702898ccd2a827db475d43bb91f76276a315c00c5765c1624e378f6e411bae12a3015db2747324323c6a1d2d'\n\n  # Send a notification email when the user's password is changed\n  # config.send_password_change_notification = false\n\n  # ==> Configuration for :confirmable\n  # A period that the user is allowed to access the website even without\n  # confirming their account. For instance, if set to 2.days, the user will be\n  # able to access the website for two days without confirming their account,\n  # access will be blocked just in the third day. Default is 0.days, meaning\n  # the user cannot access the website without confirming their account.\n  # config.allow_unconfirmed_access_for = 2.days\n\n  # A period that the user is allowed to confirm their account before their\n  # token becomes invalid. For example, if set to 3.days, the user can confirm\n  # their account within 3 days after the mail was sent, but on the fourth day\n  # their account can't be confirmed with the token any more.\n  # Default is nil, meaning there is no restriction on how long a user can take\n  # before confirming their account.\n  # config.confirm_within = 3.days\n\n  # If true, requires any email changes to be confirmed (exactly the same way as\n  # initial account confirmation) to be applied. Requires additional unconfirmed_email\n  # db field (see migrations). Until confirmed, new email is stored in\n  # unconfirmed_email column, and copied to email column on successful confirmation.\n  config.reconfirmable = true\n\n  # Defines which key will be used when confirming an account\n  # config.confirmation_keys = [:email]\n\n  # ==> Configuration for :rememberable\n  # The time the user will be remembered without asking for credentials again.\n  # config.remember_for = 2.weeks\n\n  # Invalidates all the remember me tokens when the user signs out.\n  config.expire_all_remember_me_on_sign_out = true\n\n  # If true, extends the user's remember period when remembered via cookie.\n  # config.extend_remember_period = false\n\n  # Options to be passed to the created cookie. For instance, you can set\n  # secure: true in order to force SSL only cookies.\n  # config.rememberable_options = {}\n\n  # ==> Configuration for :validatable\n  # Range for password length.\n  config.password_length = 8..72\n\n  # Email regex used to validate email formats. It simply asserts that\n  # one (and only one) @ exists in the given string. This is mainly\n  # to give user feedback and not to assert the e-mail validity.\n  # config.email_regexp = /\\A[^@]+@[^@]+\\z/\n\n  # ==> Configuration for :timeoutable\n  # The time you want to timeout the user session without activity. After this\n  # time the user will be asked for credentials again. Default is 30 minutes.\n  # config.timeout_in = 30.minutes\n\n  # ==> Configuration for :lockable\n  # Defines which strategy will be used to lock an account.\n  # :failed_attempts = Locks an account after a number of failed attempts to sign in.\n  # :none            = No lock strategy. You should handle locking by yourself.\n  # config.lock_strategy = :failed_attempts\n\n  # Defines which key will be used when locking and unlocking an account\n  # config.unlock_keys = [:email]\n\n  # Defines which strategy will be used to unlock an account.\n  # :email = Sends an unlock link to the user email\n  # :time  = Re-enables login after a certain amount of time (see :unlock_in below)\n  # :both  = Enables both strategies\n  # :none  = No unlock strategy. You should handle unlocking by yourself.\n  # config.unlock_strategy = :both\n\n  # Number of authentication tries before locking an account if lock_strategy\n  # is failed attempts.\n  # config.maximum_attempts = 20\n\n  # Time interval to unlock the account if :time is enabled as unlock_strategy.\n  # config.unlock_in = 1.hour\n\n  # Warn on the last attempt before the account is locked.\n  # config.last_attempt_warning = true\n\n  # ==> Configuration for :recoverable\n  #\n  # Defines which key will be used when recovering the password for an account\n  # config.reset_password_keys = [:email]\n\n  # Time interval you can reset your password with a reset password key.\n  # Don't put a too small interval or your users won't have the time to\n  # change their passwords.\n  config.reset_password_within = 6.hours\n\n  # When set to false, does not sign a user in automatically after their password is\n  # reset. Defaults to true, so a user is signed in automatically after a reset.\n  # config.sign_in_after_reset_password = true\n\n  # ==> Configuration for :encryptable\n  # Allow you to use another encryption algorithm besides bcrypt (default). You can use\n  # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,\n  # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)\n  # and :restful_authentication_sha1 (then you should set stretches to 10, and copy\n  # REST_AUTH_SITE_KEY to pepper).\n  #\n  # Require the `devise-encryptable` gem when using anything other than bcrypt\n  # config.encryptor = :sha512\n\n  # ==> Scopes configuration\n  # Turn scoped views on. Before rendering \"sessions/new\", it will first check for\n  # \"users/sessions/new\". It's turned off by default because it's slower if you\n  # are using only default views.\n  # config.scoped_views = false\n\n  # Configure the default scope given to Warden. By default it's the first\n  # devise role declared in your routes (usually :user).\n  # config.default_scope = :user\n\n  # Set this configuration to false if you want /users/sign_out to sign out\n  # only the current scope. By default, Devise signs out all scopes.\n  # config.sign_out_all_scopes = true\n\n  # ==> Navigation configuration\n  # Lists the formats that should be treated as navigational. Formats like\n  # :html, should redirect to the sign in page when the user does not have\n  # access, but formats like :xml or :json, should return 401.\n  #\n  # If you have any extra navigational formats, like :iphone or :mobile, you\n  # should add them to the navigational formats lists.\n  #\n  # The \"*/*\" below is required to match Internet Explorer requests.\n  # config.navigational_formats = ['*/*', :html]\n\n  # The default HTTP method used to sign out a resource. Default is :delete.\n  config.sign_out_via = :delete\n\n  # ==> OmniAuth\n  # Add a new OmniAuth provider. Check the wiki for more information on setting\n  # up on your models and hooks.\n  # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'\n\n  # ==> Warden configuration\n  # If you want to use other strategies, that are not supported by Devise, or\n  # change the failure app, you can configure them inside the config.warden block.\n  #\n  # config.warden do |manager|\n  #   manager.intercept_401 = false\n  #   manager.default_strategies(scope: :user).unshift :some_external_strategy\n  # end\n\n  # ==> Mountable engine configurations\n  # When using Devise inside an engine, let's call it `MyEngine`, and this engine\n  # is mountable, there are some extra configurations to be taken into account.\n  # The following options are available, assuming the engine is mounted as:\n  #\n  #     mount MyEngine, at: '/my_engine'\n  #\n  # The router that invoked `devise_for`, in the example above, would be:\n  # config.router_name = :my_engine\n  #\n  # When using OmniAuth, Devise cannot automatically set OmniAuth path,\n  # so you need to do it manually. For the users scope, it would be:\n  # config.omniauth_path_prefix = '/my_engine/users/auth'\nend\n"
  },
  {
    "path": "config/initializers/filter_parameter_logging.rb",
    "content": "# Be sure to restart your server when you modify this file.\n\n# Configure sensitive parameters which will be filtered from the log file.\nRails.application.config.filter_parameters += [:password]\n"
  },
  {
    "path": "config/initializers/inflections.rb",
    "content": "# Be sure to restart your server when you modify this file.\n\n# Add new inflection rules using the following format. Inflections\n# are locale specific, and you may define rules for as many different\n# locales as you wish. All of these examples are active by default:\n# ActiveSupport::Inflector.inflections(:en) do |inflect|\n#   inflect.plural /^(ox)$/i, '\\1en'\n#   inflect.singular /^(ox)en/i, '\\1'\n#   inflect.irregular 'person', 'people'\n#   inflect.uncountable %w( fish sheep )\n# end\n\n# These inflection rules are supported but not enabled by default:\n# ActiveSupport::Inflector.inflections(:en) do |inflect|\n#   inflect.acronym 'RESTful'\n# end\n"
  },
  {
    "path": "config/initializers/kaminari.rb",
    "content": "# config/initializers/kaminari.rb\nKaminari.configure do |config|\n  config.page_method_name = :per_page_kaminari\nend"
  },
  {
    "path": "config/initializers/mime_types.rb",
    "content": "# Be sure to restart your server when you modify this file.\n\n# Add new mime types for use in respond_to blocks:\n# Mime::Type.register \"text/richtext\", :rtf\n"
  },
  {
    "path": "config/initializers/session_store.rb",
    "content": "# Be sure to restart your server when you modify this file.\n\nRails.application.config.session_store :cookie_store, key: '_advisorydb_session'\n"
  },
  {
    "path": "config/initializers/simple_form.rb",
    "content": "# Use this setup block to configure all options available in SimpleForm.\nSimpleForm.setup do |config|\n  # Wrappers are used by the form builder to generate a\n  # complete input. You can remove any component from the\n  # wrapper, change the order or even add your own to the\n  # stack. The options given below are used to wrap the\n  # whole input.\n  config.wrappers :default, class: :input,\n    hint_class: :field_with_hint, error_class: :field_with_errors do |b|\n    ## Extensions enabled by default\n    # Any of these extensions can be disabled for a\n    # given input by passing: `f.input EXTENSION_NAME => false`.\n    # You can make any of these extensions optional by\n    # renaming `b.use` to `b.optional`.\n\n    # Determines whether to use HTML5 (:email, :url, ...)\n    # and required attributes\n    b.use :html5\n\n    # Calculates placeholders automatically from I18n\n    # You can also pass a string as f.input placeholder: \"Placeholder\"\n    b.use :placeholder\n\n    ## Optional extensions\n    # They are disabled unless you pass `f.input EXTENSION_NAME => true`\n    # to the input. If so, they will retrieve the values from the model\n    # if any exists. If you want to enable any of those\n    # extensions by default, you can change `b.optional` to `b.use`.\n\n    # Calculates maxlength from length validations for string inputs\n    b.optional :maxlength\n\n    # Calculates pattern from format validations for string inputs\n    b.optional :pattern\n\n    # Calculates min and max from length validations for numeric inputs\n    b.optional :min_max\n\n    # Calculates readonly automatically from readonly attributes\n    b.optional :readonly\n\n    ## Inputs\n    b.use :label_input\n    b.use :hint,  wrap_with: { tag: :span, class: :hint }\n    b.use :error, wrap_with: { tag: :span, class: :error }\n\n    ## full_messages_for\n    # If you want to display the full error message for the attribute, you can\n    # use the component :full_error, like:\n    #\n    # b.use :full_error, wrap_with: { tag: :span, class: :error }\n  end\n\n  # The default wrapper to be used by the FormBuilder.\n  config.default_wrapper = :default\n\n  # Define the way to render check boxes / radio buttons with labels.\n  # Defaults to :nested for bootstrap config.\n  #   inline: input + label\n  #   nested: label > input\n  config.boolean_style = :nested\n\n  # Default class for buttons\n  config.button_class = 'btn'\n\n  # Method used to tidy up errors. Specify any Rails Array method.\n  # :first lists the first message for each field.\n  # Use :to_sentence to list all errors for each field.\n  # config.error_method = :first\n\n  # Default tag used for error notification helper.\n  config.error_notification_tag = :div\n\n  # CSS class to add for error notification helper.\n  config.error_notification_class = 'error_notification'\n\n  # ID to add for error notification helper.\n  # config.error_notification_id = nil\n\n  # Series of attempts to detect a default label method for collection.\n  # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]\n\n  # Series of attempts to detect a default value method for collection.\n  # config.collection_value_methods = [ :id, :to_s ]\n\n  # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.\n  # config.collection_wrapper_tag = nil\n\n  # You can define the class to use on all collection wrappers. Defaulting to none.\n  # config.collection_wrapper_class = nil\n\n  # You can wrap each item in a collection of radio/check boxes with a tag,\n  # defaulting to :span.\n  # config.item_wrapper_tag = :span\n\n  # You can define a class to use in all item wrappers. Defaulting to none.\n  # config.item_wrapper_class = nil\n\n  # How the label text should be generated altogether with the required text.\n  # config.label_text = lambda { |label, required, explicit_label| \"#{required} #{label}\" }\n\n  # You can define the class to use on all labels. Default is nil.\n  # config.label_class = nil\n\n  # You can define the default class to be used on forms. Can be overriden\n  # with `html: { :class }`. Defaulting to none.\n  # config.default_form_class = nil\n\n  # You can define which elements should obtain additional classes\n  # config.generate_additional_classes_for = [:wrapper, :label, :input]\n\n  # Whether attributes are required by default (or not). Default is true.\n  # config.required_by_default = true\n\n  # Tell browsers whether to use the native HTML5 validations (novalidate form option).\n  # These validations are enabled in SimpleForm's internal config but disabled by default\n  # in this configuration, which is recommended due to some quirks from different browsers.\n  # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,\n  # change this configuration to true.\n  config.browser_validations = false\n\n  # Collection of methods to detect if a file type was given.\n  # config.file_methods = [ :mounted_as, :file?, :public_filename ]\n\n  # Custom mappings for input types. This should be a hash containing a regexp\n  # to match as key, and the input type that will be used when the field name\n  # matches the regexp as value.\n  # config.input_mappings = { /count/ => :integer }\n\n  # Custom wrappers for input types. This should be a hash containing an input\n  # type as key and the wrapper that will be used for all inputs with specified type.\n  # config.wrapper_mappings = { string: :prepend }\n\n  # Namespaces where SimpleForm should look for custom input classes that\n  # override default inputs.\n  # config.custom_inputs_namespaces << \"CustomInputs\"\n\n  # Default priority for time_zone inputs.\n  # config.time_zone_priority = nil\n\n  # Default priority for country inputs.\n  # config.country_priority = nil\n\n  # When false, do not use translations for labels.\n  # config.translate_labels = true\n\n  # Automatically discover new inputs in Rails' autoload path.\n  # config.inputs_discovery = true\n\n  # Cache SimpleForm inputs discovery\n  # config.cache_discovery = !Rails.env.development?\n\n  # Default class for inputs\n  # config.input_class = nil\n\n  # Define the default class of the input wrapper of the boolean input.\n  config.boolean_label_class = 'checkbox'\n\n  # Defines if the default input wrapper class should be included in radio\n  # collection wrappers.\n  # config.include_default_input_wrapper_class = true\n\n  # Defines which i18n scope will be used in Simple Form.\n  # config.i18n_scope = 'simple_form'\nend\n"
  },
  {
    "path": "config/initializers/wrap_parameters.rb",
    "content": "# Be sure to restart your server when you modify this file.\n\n# This file contains settings for ActionController::ParamsWrapper which\n# is enabled by default.\n\n# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.\nActiveSupport.on_load(:action_controller) do\n  wrap_parameters format: [:json] if respond_to?(:wrap_parameters)\nend\n\n# To enable root element in JSON for ActiveRecord objects.\n# ActiveSupport.on_load(:active_record) do\n#  self.include_root_in_json = true\n# end\n"
  },
  {
    "path": "config/locales/devise.en.yml",
    "content": "# Additional translations at https://github.com/plataformatec/devise/wiki/I18n\n\nen:\n  devise:\n    confirmations:\n      confirmed: \"Your email address has been successfully confirmed.\"\n      send_instructions: \"You will receive an email with instructions for how to confirm your email address in a few minutes.\"\n      send_paranoid_instructions: \"If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes.\"\n    failure:\n      already_authenticated: \"You are already signed in.\"\n      inactive: \"Your account is not activated yet.\"\n      invalid: \"Invalid %{authentication_keys} or password.\"\n      locked: \"Your account is locked.\"\n      last_attempt: \"You have one more attempt before your account is locked.\"\n      not_found_in_database: \"Invalid %{authentication_keys} or password.\"\n      timeout: \"Your session expired. Please sign in again to continue.\"\n      unauthenticated: \"You need to sign in or sign up before continuing.\"\n      unconfirmed: \"You have to confirm your email address before continuing.\"\n    mailer:\n      confirmation_instructions:\n        subject: \"Confirmation instructions\"\n      reset_password_instructions:\n        subject: \"Reset password instructions\"\n      unlock_instructions:\n        subject: \"Unlock instructions\"\n      password_change:\n        subject: \"Password Changed\"\n    omniauth_callbacks:\n      failure: \"Could not authenticate you from %{kind} because \\\"%{reason}\\\".\"\n      success: \"Successfully authenticated from %{kind} account.\"\n    passwords:\n      no_token: \"You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided.\"\n      send_instructions: \"You will receive an email with instructions on how to reset your password in a few minutes.\"\n      send_paranoid_instructions: \"If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes.\"\n      updated: \"Your password has been changed successfully. You are now signed in.\"\n      updated_not_active: \"Your password has been changed successfully.\"\n    registrations:\n      destroyed: \"Bye! Your account has been successfully cancelled. We hope to see you again soon.\"\n      signed_up: \"Welcome! You have signed up successfully.\"\n      signed_up_but_inactive: \"You have signed up successfully. However, we could not sign you in because your account is not yet activated.\"\n      signed_up_but_locked: \"You have signed up successfully. However, we could not sign you in because your account is locked.\"\n      signed_up_but_unconfirmed: \"A message with a confirmation link has been sent to your email address. Please follow the link to activate your account.\"\n      update_needs_confirmation: \"You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address.\"\n      updated: \"Your account has been updated successfully.\"\n    sessions:\n      signed_in: \"Signed in successfully.\"\n      signed_out: \"Signed out successfully.\"\n      already_signed_out: \"Signed out successfully.\"\n    unlocks:\n      send_instructions: \"You will receive an email with instructions for how to unlock your account in a few minutes.\"\n      send_paranoid_instructions: \"If your account exists, you will receive an email with instructions for how to unlock it in a few minutes.\"\n      unlocked: \"Your account has been unlocked successfully. Please sign in to continue.\"\n  errors:\n    messages:\n      already_confirmed: \"was already confirmed, please try signing in\"\n      confirmation_period_expired: \"needs to be confirmed within %{period}, please request a new one\"\n      expired: \"has expired, please request a new one\"\n      not_found: \"not found\"\n      not_locked: \"was not locked\"\n      not_saved:\n        one: \"1 error prohibited this %{resource} from being saved:\"\n        other: \"%{count} errors prohibited this %{resource} from being saved:\"\n"
  },
  {
    "path": "config/locales/en.yml",
    "content": "# Files in the config/locales directory are used for internationalization\n# and are automatically loaded by Rails. If you want to use locales other\n# than English, add the necessary files in this directory.\n#\n# To use the locales, use `I18n.t`:\n#\n#     I18n.t 'hello'\n#\n# In views, this is aliased to just `t`:\n#\n#     <%= t('hello') %>\n#\n# To use a different locale, set it with `I18n.locale`:\n#\n#     I18n.locale = :es\n#\n# This would use the information in config/locales/es.yml.\n#\n# To learn more, please read the Rails Internationalization guide\n# available at http://guides.rubyonrails.org/i18n.html.\n\nen:\n  hello: \"Hello world\"\n"
  },
  {
    "path": "config/locales/simple_form.en.yml",
    "content": "en:\n  simple_form:\n    \"yes\": 'Yes'\n    \"no\": 'No'\n    required:\n      text: 'required'\n      mark: '*'\n      # You can uncomment the line below if you need to overwrite the whole required html.\n      # When using html, text and mark won't be used.\n      # html: '<abbr title=\"required\">*</abbr>'\n    error_notification:\n      default_message: \"Please review the problems below:\"\n    # Examples\n    # labels:\n    #   defaults:\n    #     password: 'Password'\n    #   user:\n    #     new:\n    #       email: 'E-mail to sign in.'\n    #     edit:\n    #       email: 'E-mail.'\n    # hints:\n    #   defaults:\n    #     username: 'User name to sign in.'\n    #     password: 'No special characters, please.'\n    # include_blanks:\n    #   defaults:\n    #     age: 'Rather not say'\n    # prompts:\n    #   defaults:\n    #     age: 'Select your age'\n"
  },
  {
    "path": "config/locales/social_share_button.en.yml",
    "content": "en:\n  social_share_button:\n    share_to: Share to %{name}\n    weibo: Sina Weibo\n    twitter: Twitter\n    facebook: Facebook\n    douban: Douban\n    qq: Qzone\n    tqq: Tqq\n    delicious: Delicious\n    baidu: Baidu.com\n    kaixin001: Kaixin001.com\n    renren: Renren.com\n    google_plus: Google+\n    google_bookmark: Google Bookmark\n    tumblr: Tumblr\n    plurk: Plurk\n    pinterest: Pinterest\n    email: Email\n"
  },
  {
    "path": "config/locales/social_share_button.zh-CN.yml",
    "content": "'zh-CN':\n  social_share_button:\n    share_to: 分享到 %{name}\n    weibo: 新浪微博\n    twitter: Twitter\n    facebook: Facebook\n    douban: 豆瓣\n    qq: QQ空间\n    tqq: 腾讯微博\n    delicious: Delicious\n    baidu: 百度收藏\n    kaixin001: 开心网\n    renren: 人人网\n    google_plus: Google+\n    google_bookmark: Google 收藏\n    tumblr: Tumblr\n    plurk: Plurk\n    pinterest: Pinterest\n    email: Email\n"
  },
  {
    "path": "config/locales/social_share_button.zh-TW.yml",
    "content": "'zh-TW':\n  social_share_button:\n    share_to: 分享到 %{name}\n    weibo: 新浪微博\n    twitter: Twitter\n    facebook: Facebook\n    douban: 豆瓣\n    qq: QQ空間\n    tqq: 腾讯微博\n    delicious: Delicious\n    baidu: 百度收藏\n    kaixin001: 開心網\n    renren: 人人網\n    google_plus: Google+\n    google_bookmark: Google 收藏\n    tumblr: Tumblr\n    plurk: 噗浪\n    pinterest: Pinterest\n    email: Email\n"
  },
  {
    "path": "config/railscomposer.yml",
    "content": "# This application was generated with Rails Composer\n\ndevelopment:\n  apps4: rails-devise-roles\n  announcements: none\n  dev_webserver: webrick\n  prod_webserver: puma\n  database: postgresql\n  templates: haml\n  tests: rspec\n  continuous_testing: guard\n  frontend: bootstrap3\n  email: gmail\n  authentication: devise\n  devise_modules: invitable\n  omniauth_provider: \n  authorization: roles\n  form_builder: simple_form\n  pages: about+users\n  layouts: bare\n  locale: none\n  analytics: \n  deployment: \n  ban_spiders: \n  github: \n  local_env_file: false\n  quiet_assets: true\n  better_errors: true\n  pry: false\n  rvmrc: \n  dashboard: upmin\n"
  },
  {
    "path": "config/routes.rb",
    "content": "Rails.application.routes.draw do\n\n\n  resources :section_templates \n  resources :sections\n  resources :captures\n  resources :devices\n  resources :devices do\n    post 'apply_template' => \"devices#apply_template\"\n    resources :sections \n    resources :units do\n      resources :captures do\n        post 'shift_left', to: 'captures#shift_left'\n        post 'shift_right', to: 'captures#shift_right'\n      end\n    end\n  end\n  resources :units\n\n  # resources :challenge_attempts, :except => [:edit, :update, :show, :destroy]\n  # resources :challenges, :except => [:edit, :update, :destroy]\n  #\n  # resources :challenges, :except => [:edit, :update, :destroy] do\n  #   resources :challenge_attempts, :except => [:edit, :update, :show, :destroy]\n  # end\n\n\n  post 'generate', to: 'sections#generate'\n\n  # get 'profiles', to: 'profile#index'\n  get 'profile', to: 'profile#show'\n  # get 'profile/:id', to: 'profile#show'\n\n  get 'profile/edit'\n\n  devise_for :users, :controllers => { registrations: 'registrations' }\n\n\n  get '/about', to: 'dashboard#about'\n\n  get '/temp', to: 'dashboard#temp'\n\n  get '/contribute', to: 'dashboard#contribute'\n\n\n\n  root 'devices#index'\nend\n"
  },
  {
    "path": "config/secrets.yml",
    "content": "# Be sure to restart your server when you modify this file.\n\n# Your secret key is used for verifying the integrity of signed cookies.\n# If you change this key, all old signed cookies will become invalid!\n\n# Make sure the secret is at least 30 characters and all random,\n# no regular words or you'll be exposed to dictionary attacks.\n# You can use `rake secret` to generate a secure secret key.\n\n# Make sure the secrets in this file are kept private\n# if you're sharing your code publicly.\n\ndevelopment:\n  secret_key_base: c9e2ad75f8cd301df9c4c770ac47579464172d05d88ec7f0c5a050884b321adf843b2f33c3c0776689a8978cbf4f7963bd1d307870423be311ecedba4e191553\n\ntest:\n  secret_key_base: 12759866d8d9b1206451b4f53c65b038140db7acbe1824bdb342ae83a02acdb3b377172e67eea09af9113bd2f9a7daf8634926d8317a6c9d3cb14cc5288919c8\n\n# Do not keep production secrets in the repository,\n# instead read values from the environment.\nproduction:\n  secret_key_base: <%= ENV[\"SECRET_KEY_BASE\"] %>\n"
  },
  {
    "path": "config.ru",
    "content": "# This file is used by Rack-based servers to start the application.\n\nrequire ::File.expand_path('../config/environment', __FILE__)\nrun Rails.application\n"
  },
  {
    "path": "db/migrate/20160225071956_devise_create_users.rb",
    "content": "class DeviseCreateUsers < ActiveRecord::Migration\n  def change\n    create_table(:users) do |t|\n      ## Database authenticatable\n      t.string :email,              null: false, default: \"\"\n      t.string :encrypted_password, null: false, default: \"\"\n\n      ## Recoverable\n      t.string   :reset_password_token\n      t.datetime :reset_password_sent_at\n\n      ## Rememberable\n      t.datetime :remember_created_at\n\n      ## Trackable\n      t.integer  :sign_in_count, default: 0, null: false\n      t.datetime :current_sign_in_at\n      t.datetime :last_sign_in_at\n      t.string   :current_sign_in_ip\n      t.string   :last_sign_in_ip\n\n      ## Confirmable\n      # t.string   :confirmation_token\n      # t.datetime :confirmed_at\n      # t.datetime :confirmation_sent_at\n      # t.string   :unconfirmed_email # Only if using reconfirmable\n\n      ## Lockable\n      # t.integer  :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts\n      # t.string   :unlock_token # Only if unlock strategy is :email or :both\n      # t.datetime :locked_at\n\n\n      t.timestamps null: false\n      \n    end\n\n    add_index :users, :email,                unique: true\n    add_index :users, :reset_password_token, unique: true\n    # add_index :users, :confirmation_token,   unique: true\n    # add_index :users, :unlock_token,         unique: true\n  end\nend\n"
  },
  {
    "path": "db/migrate/20160227015521_add_full_name_to_user.rb",
    "content": "class AddFullNameToUser < ActiveRecord::Migration\n  def change\n    add_column :users, :full_name, :string\n  end\nend\n"
  },
  {
    "path": "db/migrate/20160918060423_create_devices.rb",
    "content": "class CreateDevices < ActiveRecord::Migration\n  def change\n    create_table :devices do |t|\n      t.string :fcc_id\n      t.string :baudrate\n      t.float :frequency\n      t.string :modulation\n      t.string :encoding\n      t.string :name\n      t.text :notes\n\n      t.timestamps null: false\n    end\n  end\nend\n"
  },
  {
    "path": "db/migrate/20160918060509_create_units.rb",
    "content": "class CreateUnits < ActiveRecord::Migration\n  def change\n    create_table :units do |t|\n      t.integer :device_id\n      t.string :name\n      t.text :notes\n\n      t.timestamps null: false\n    end\n  end\nend\n"
  },
  {
    "path": "db/migrate/20160918060631_create_captures.rb",
    "content": "class CreateCaptures < ActiveRecord::Migration\n  def change\n    create_table :captures do |t|\n      t.integer :unit_id\n      t.integer :device_id\n      t.string :name\n      t.text :notes\n      t.text :binary\n      t.text :original_binary\n\n      t.timestamps null: false\n    end\n  end\nend\n"
  },
  {
    "path": "db/migrate/20170515023720_create_sections.rb",
    "content": "class CreateSections < ActiveRecord::Migration\n  def change\n    create_table :sections do |t|\n      t.integer :device_id\n      t.string :name\n      t.string :notes\n      t.integer :start_pos\n      t.integer :end_pos\n      t.string :colour\n\n      t.timestamps null: false\n    end\n  end\nend\n"
  },
  {
    "path": "db/migrate/20170520033410_add_flip_pwm_to_devices.rb",
    "content": "class AddFlipPwmToDevices < ActiveRecord::Migration\n  def change\n    add_column :devices, :flip_pwm, :boolean\n  end\nend\n"
  },
  {
    "path": "db/migrate/20170525084143_create_section_templates.rb",
    "content": "class CreateSectionTemplates < ActiveRecord::Migration\n  def change\n    create_table :section_templates do |t|\n      t.string :name\n      t.text :sections\n      t.string :added_by\n\n      t.timestamps null: false\n    end\n  end\nend\n"
  },
  {
    "path": "db/schema.rb",
    "content": "# encoding: UTF-8\n# This file is auto-generated from the current state of the database. Instead\n# of editing this file, please use the migrations feature of Active Record to\n# incrementally modify your database, and then regenerate this schema definition.\n#\n# Note that this schema.rb definition is the authoritative source for your\n# database schema. If you need to create the application database on another\n# system, you should be using db:schema:load, not running all the migrations\n# from scratch. The latter is a flawed and unsustainable approach (the more migrations\n# you'll amass, the slower it'll run and the greater likelihood for issues).\n#\n# It's strongly recommended that you check this file into your version control system.\n\nActiveRecord::Schema.define(version: 20170525084143) do\n\n  create_table \"captures\", force: :cascade do |t|\n    t.integer  \"unit_id\"\n    t.integer  \"device_id\"\n    t.string   \"name\"\n    t.text     \"notes\"\n    t.text     \"binary\"\n    t.text     \"original_binary\"\n    t.datetime \"created_at\",      null: false\n    t.datetime \"updated_at\",      null: false\n  end\n\n  create_table \"devices\", force: :cascade do |t|\n    t.string   \"fcc_id\"\n    t.string   \"baudrate\"\n    t.float    \"frequency\"\n    t.string   \"modulation\"\n    t.string   \"encoding\"\n    t.string   \"name\"\n    t.text     \"notes\"\n    t.datetime \"created_at\", null: false\n    t.datetime \"updated_at\", null: false\n    t.boolean  \"flip_pwm\"\n  end\n\n  create_table \"section_templates\", force: :cascade do |t|\n    t.string   \"name\"\n    t.text     \"sections\"\n    t.string   \"added_by\"\n    t.datetime \"created_at\", null: false\n    t.datetime \"updated_at\", null: false\n  end\n\n  create_table \"sections\", force: :cascade do |t|\n    t.integer  \"device_id\"\n    t.string   \"name\"\n    t.string   \"notes\"\n    t.integer  \"start_pos\"\n    t.integer  \"end_pos\"\n    t.string   \"colour\"\n    t.datetime \"created_at\", null: false\n    t.datetime \"updated_at\", null: false\n  end\n\n  create_table \"units\", force: :cascade do |t|\n    t.integer  \"device_id\"\n    t.string   \"name\"\n    t.text     \"notes\"\n    t.datetime \"created_at\", null: false\n    t.datetime \"updated_at\", null: false\n  end\n\n  create_table \"users\", force: :cascade do |t|\n    t.string   \"email\",                  default: \"\", null: false\n    t.string   \"encrypted_password\",     default: \"\", null: false\n    t.string   \"reset_password_token\"\n    t.datetime \"reset_password_sent_at\"\n    t.datetime \"remember_created_at\"\n    t.integer  \"sign_in_count\",          default: 0,  null: false\n    t.datetime \"current_sign_in_at\"\n    t.datetime \"last_sign_in_at\"\n    t.string   \"current_sign_in_ip\"\n    t.string   \"last_sign_in_ip\"\n    t.datetime \"created_at\",                          null: false\n    t.datetime \"updated_at\",                          null: false\n    t.string   \"full_name\"\n  end\n\n  add_index \"users\", [\"email\"], name: \"index_users_on_email\", unique: true\n  add_index \"users\", [\"reset_password_token\"], name: \"index_users_on_reset_password_token\", unique: true\n\nend\n"
  },
  {
    "path": "db/seeds.rb",
    "content": "u = User.find_or_create_by(:email => \"user@example.com\") do |user|\n  user.password = \"password\"\n  user.password_confirmation = \"password\"\n  user.full_name = \"Nameless\"\nend\nputs \"Seeded user: #{u.full_name} (#{u.email})\"\n\nputs \"Seeding Section Template Library\"\nDir[File.join(Rails.root, 'db', 'template_seeds', '*.rb')].sort.each { |seed| load seed }\nputs \"#{SectionTemplate.all.count} templates imported into library\"\n"
  },
  {
    "path": "db/template_seeds/user_contributions.rb",
    "content": "SectionTemplate.find_or_create_by(:name => \"Generic Wireless Alarm System\") do |st|\nst.sections = \"name,start_pos,end_pos,colour,notes\nDevice ID,0,15,indigo,Changes between devices; static across functions. Must be device id. Recommend expressing this as an integer.\nFunction Code,16,23,darkgreen,Static between devices as long as same button is pressed. Must be the button. Lets call it the function code. Recommend expressing this as an integer.\nPacket Terminator,24,24,gray,This bit is always 0 so far. We're just going to assume it's a packet terminator.\" \nst.added_by = 'nullwolf' \nend\n\n"
  },
  {
    "path": "lib/assets/.keep",
    "content": ""
  },
  {
    "path": "lib/tasks/.keep",
    "content": ""
  },
  {
    "path": "lib/tasks/account_seeds.rake",
    "content": "namespace :dspectrum do\n\ttask :accounts => :environment do\n\n\t\t#####\n\t\t#  User\n\t\t####\n\n\t\tputs \"[!] Seeding user\"\n\n\t\tu = User.create!(:email => \"user@example.com\", :full_name => \"some guy\", :password => \"password\", :password_confirmation => \"password\")\n\tend\nend"
  },
  {
    "path": "lib/tasks/custom_seed.rake",
    "content": "# lib/tasks/custom_seed.rake\n\n# rake db:custom_seed\n\nnamespace :dspectrum do\n  task :seed do\n  \tputs \n  \tputs \n  \tputs \"[*] Starting Seeds\"\n  \tputs\n  \tputs \"[*] Seeding Accounts\"\n    Rake::Task['dspectrum:accounts'].invoke\n    puts\n  end\n\n  \nend"
  },
  {
    "path": "lib/templates/haml/scaffold/_form.html.haml",
    "content": "= simple_form_for(@<%= singular_table_name %>) do |f|\n  = f.error_notification\n\n  .form-inputs\n  <%- attributes.each do |attribute| -%>\n    = f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>\n  <%- end -%>\n\n  .form-actions\n    = f.button :submit\n"
  },
  {
    "path": "public/404.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <title>The page you were looking for doesn't exist (404)</title>\n  <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n  <style>\n  body {\n    background-color: #EFEFEF;\n    color: #2E2F30;\n    text-align: center;\n    font-family: arial, sans-serif;\n    margin: 0;\n  }\n\n  div.dialog {\n    width: 95%;\n    max-width: 33em;\n    margin: 4em auto 0;\n  }\n\n  div.dialog > div {\n    border: 1px solid #CCC;\n    border-right-color: #999;\n    border-left-color: #999;\n    border-bottom-color: #BBB;\n    border-top: #B00100 solid 4px;\n    border-top-left-radius: 9px;\n    border-top-right-radius: 9px;\n    background-color: white;\n    padding: 7px 12% 0;\n    box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);\n  }\n\n  h1 {\n    font-size: 100%;\n    color: #730E15;\n    line-height: 1.5em;\n  }\n\n  div.dialog > p {\n    margin: 0 0 1em;\n    padding: 1em;\n    background-color: #F7F7F7;\n    border: 1px solid #CCC;\n    border-right-color: #999;\n    border-left-color: #999;\n    border-bottom-color: #999;\n    border-bottom-left-radius: 4px;\n    border-bottom-right-radius: 4px;\n    border-top-color: #DADADA;\n    color: #666;\n    box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);\n  }\n  </style>\n</head>\n\n<body>\n  <!-- This file lives in public/404.html -->\n  <div class=\"dialog\">\n    <div>\n      <h1>The page you were looking for doesn't exist.</h1>\n      <p>You may have mistyped the address or the page may have moved.</p>\n    </div>\n    <p>If you are the application owner check the logs for more information.</p>\n  </div>\n</body>\n</html>\n"
  },
  {
    "path": "public/422.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <title>The change you wanted was rejected (422)</title>\n  <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n  <style>\n  body {\n    background-color: #EFEFEF;\n    color: #2E2F30;\n    text-align: center;\n    font-family: arial, sans-serif;\n    margin: 0;\n  }\n\n  div.dialog {\n    width: 95%;\n    max-width: 33em;\n    margin: 4em auto 0;\n  }\n\n  div.dialog > div {\n    border: 1px solid #CCC;\n    border-right-color: #999;\n    border-left-color: #999;\n    border-bottom-color: #BBB;\n    border-top: #B00100 solid 4px;\n    border-top-left-radius: 9px;\n    border-top-right-radius: 9px;\n    background-color: white;\n    padding: 7px 12% 0;\n    box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);\n  }\n\n  h1 {\n    font-size: 100%;\n    color: #730E15;\n    line-height: 1.5em;\n  }\n\n  div.dialog > p {\n    margin: 0 0 1em;\n    padding: 1em;\n    background-color: #F7F7F7;\n    border: 1px solid #CCC;\n    border-right-color: #999;\n    border-left-color: #999;\n    border-bottom-color: #999;\n    border-bottom-left-radius: 4px;\n    border-bottom-right-radius: 4px;\n    border-top-color: #DADADA;\n    color: #666;\n    box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);\n  }\n  </style>\n</head>\n\n<body>\n  <!-- This file lives in public/422.html -->\n  <div class=\"dialog\">\n    <div>\n      <h1>The change you wanted was rejected.</h1>\n      <p>Maybe you tried to change something you didn't have access to.</p>\n    </div>\n    <p>If you are the application owner check the logs for more information.</p>\n  </div>\n</body>\n</html>\n"
  },
  {
    "path": "public/500.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <title>We're sorry, but something went wrong (500)</title>\n  <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n  <style>\n  body {\n    background-color: #EFEFEF;\n    color: #2E2F30;\n    text-align: center;\n    font-family: arial, sans-serif;\n    margin: 0;\n  }\n\n  div.dialog {\n    width: 95%;\n    max-width: 33em;\n    margin: 4em auto 0;\n  }\n\n  div.dialog > div {\n    border: 1px solid #CCC;\n    border-right-color: #999;\n    border-left-color: #999;\n    border-bottom-color: #BBB;\n    border-top: #B00100 solid 4px;\n    border-top-left-radius: 9px;\n    border-top-right-radius: 9px;\n    background-color: white;\n    padding: 7px 12% 0;\n    box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);\n  }\n\n  h1 {\n    font-size: 100%;\n    color: #730E15;\n    line-height: 1.5em;\n  }\n\n  div.dialog > p {\n    margin: 0 0 1em;\n    padding: 1em;\n    background-color: #F7F7F7;\n    border: 1px solid #CCC;\n    border-right-color: #999;\n    border-left-color: #999;\n    border-bottom-color: #999;\n    border-bottom-left-radius: 4px;\n    border-bottom-right-radius: 4px;\n    border-top-color: #DADADA;\n    color: #666;\n    box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);\n  }\n  </style>\n</head>\n\n<body>\n  <!-- This file lives in public/500.html -->\n  <div class=\"dialog\">\n    <div>\n      <h1>We're sorry, but something went wrong.</h1>\n    </div>\n    <p>If you are the application owner check the logs for more information.</p>\n  </div>\n</body>\n</html>\n"
  },
  {
    "path": "public/robots.txt",
    "content": "# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file\n#\n# To ban all spiders from the entire site uncomment the next two lines:\n# User-agent: *\n# Disallow: /\n"
  },
  {
    "path": "spec/controllers/captures_controller_spec.rb",
    "content": "# require 'rails_helper'\n\n# # This spec was generated by rspec-rails when you ran the scaffold generator.\n# # It demonstrates how one might use RSpec to specify the controller code that\n# # was generated by Rails when you ran the scaffold generator.\n# #\n# # It assumes that the implementation code is generated by the rails scaffold\n# # generator.  If you are using any extension libraries to generate different\n# # controller code, this generated spec may or may not pass.\n# #\n# # It only uses APIs available in rails and/or rspec-rails.  There are a number\n# # of tools you can use to make these specs even more expressive, but we're\n# # sticking to rails and rspec-rails APIs to keep things simple and stable.\n# #\n# # Compared to earlier versions of this generator, there is very limited use of\n# # stubs and message expectations in this spec.  Stubs are only used when there\n# # is no simpler way to get a handle on the object needed for the example.\n# # Message expectations are only used when there is no simpler way to specify\n# # that an instance is receiving a specific message.\n\n# RSpec.describe CapturesController, type: :controller do\n\n#   # This should return the minimal set of attributes required to create a valid\n#   # Capture. As you add validations to Capture, be sure to\n#   # adjust the attributes here as well.\n#   let(:valid_attributes) {\n#     skip(\"Add a hash of attributes valid for your model\")\n#   }\n\n#   let(:invalid_attributes) {\n#     skip(\"Add a hash of attributes invalid for your model\")\n#   }\n\n#   # This should return the minimal set of values that should be in the session\n#   # in order to pass any filters (e.g. authentication) defined in\n#   # CapturesController. Be sure to keep this updated too.\n#   let(:valid_session) { {} }\n\n#   describe \"GET #index\" do\n#     it \"assigns all captures as @captures\" do\n#       capture = Capture.create! valid_attributes\n#       get :index, {}, valid_session\n#       expect(assigns(:captures)).to eq([capture])\n#     end\n#   end\n\n#   describe \"GET #show\" do\n#     it \"assigns the requested capture as @capture\" do\n#       capture = Capture.create! valid_attributes\n#       get :show, {:id => capture.to_param}, valid_session\n#       expect(assigns(:capture)).to eq(capture)\n#     end\n#   end\n\n#   describe \"GET #new\" do\n#     it \"assigns a new capture as @capture\" do\n#       get :new, {}, valid_session\n#       expect(assigns(:capture)).to be_a_new(Capture)\n#     end\n#   end\n\n#   describe \"GET #edit\" do\n#     it \"assigns the requested capture as @capture\" do\n#       capture = Capture.create! valid_attributes\n#       get :edit, {:id => capture.to_param}, valid_session\n#       expect(assigns(:capture)).to eq(capture)\n#     end\n#   end\n\n#   describe \"POST #create\" do\n#     context \"with valid params\" do\n#       it \"creates a new Capture\" do\n#         expect {\n#           post :create, {:capture => valid_attributes}, valid_session\n#         }.to change(Capture, :count).by(1)\n#       end\n\n#       it \"assigns a newly created capture as @capture\" do\n#         post :create, {:capture => valid_attributes}, valid_session\n#         expect(assigns(:capture)).to be_a(Capture)\n#         expect(assigns(:capture)).to be_persisted\n#       end\n\n#       it \"redirects to the created capture\" do\n#         post :create, {:capture => valid_attributes}, valid_session\n#         expect(response).to redirect_to(Capture.last)\n#       end\n#     end\n\n#     context \"with invalid params\" do\n#       it \"assigns a newly created but unsaved capture as @capture\" do\n#         post :create, {:capture => invalid_attributes}, valid_session\n#         expect(assigns(:capture)).to be_a_new(Capture)\n#       end\n\n#       it \"re-renders the 'new' template\" do\n#         post :create, {:capture => invalid_attributes}, valid_session\n#         expect(response).to render_template(\"new\")\n#       end\n#     end\n#   end\n\n#   describe \"PUT #update\" do\n#     context \"with valid params\" do\n#       let(:new_attributes) {\n#         skip(\"Add a hash of attributes valid for your model\")\n#       }\n\n#       it \"updates the requested capture\" do\n#         capture = Capture.create! valid_attributes\n#         put :update, {:id => capture.to_param, :capture => new_attributes}, valid_session\n#         capture.reload\n#         skip(\"Add assertions for updated state\")\n#       end\n\n#       it \"assigns the requested capture as @capture\" do\n#         capture = Capture.create! valid_attributes\n#         put :update, {:id => capture.to_param, :capture => valid_attributes}, valid_session\n#         expect(assigns(:capture)).to eq(capture)\n#       end\n\n#       it \"redirects to the capture\" do\n#         capture = Capture.create! valid_attributes\n#         put :update, {:id => capture.to_param, :capture => valid_attributes}, valid_session\n#         expect(response).to redirect_to(capture)\n#       end\n#     end\n\n#     context \"with invalid params\" do\n#       it \"assigns the capture as @capture\" do\n#         capture = Capture.create! valid_attributes\n#         put :update, {:id => capture.to_param, :capture => invalid_attributes}, valid_session\n#         expect(assigns(:capture)).to eq(capture)\n#       end\n\n#       it \"re-renders the 'edit' template\" do\n#         capture = Capture.create! valid_attributes\n#         put :update, {:id => capture.to_param, :capture => invalid_attributes}, valid_session\n#         expect(response).to render_template(\"edit\")\n#       end\n#     end\n#   end\n\n#   describe \"DELETE #destroy\" do\n#     it \"destroys the requested capture\" do\n#       capture = Capture.create! valid_attributes\n#       expect {\n#         delete :destroy, {:id => capture.to_param}, valid_session\n#       }.to change(Capture, :count).by(-1)\n#     end\n\n#     it \"redirects to the captures list\" do\n#       capture = Capture.create! valid_attributes\n#       delete :destroy, {:id => capture.to_param}, valid_session\n#       expect(response).to redirect_to(captures_url)\n#     end\n#   end\n\n# end\n"
  },
  {
    "path": "spec/controllers/devices_controller_spec.rb",
    "content": "# require 'rails_helper'\n\n# # This spec was generated by rspec-rails when you ran the scaffold generator.\n# # It demonstrates how one might use RSpec to specify the controller code that\n# # was generated by Rails when you ran the scaffold generator.\n# #\n# # It assumes that the implementation code is generated by the rails scaffold\n# # generator.  If you are using any extension libraries to generate different\n# # controller code, this generated spec may or may not pass.\n# #\n# # It only uses APIs available in rails and/or rspec-rails.  There are a number\n# # of tools you can use to make these specs even more expressive, but we're\n# # sticking to rails and rspec-rails APIs to keep things simple and stable.\n# #\n# # Compared to earlier versions of this generator, there is very limited use of\n# # stubs and message expectations in this spec.  Stubs are only used when there\n# # is no simpler way to get a handle on the object needed for the example.\n# # Message expectations are only used when there is no simpler way to specify\n# # that an instance is receiving a specific message.\n\n# RSpec.describe DevicesController, type: :controller do\n\n#   # This should return the minimal set of attributes required to create a valid\n#   # Device. As you add validations to Device, be sure to\n#   # adjust the attributes here as well.\n#   let(:valid_attributes) {\n#     skip(\"Add a hash of attributes valid for your model\")\n#   }\n\n#   let(:invalid_attributes) {\n#     skip(\"Add a hash of attributes invalid for your model\")\n#   }\n\n#   # This should return the minimal set of values that should be in the session\n#   # in order to pass any filters (e.g. authentication) defined in\n#   # DevicesController. Be sure to keep this updated too.\n#   let(:valid_session) { {} }\n\n#   describe \"GET #index\" do\n#     it \"assigns all devices as @devices\" do\n#       device = Device.create! valid_attributes\n#       get :index, {}, valid_session\n#       expect(assigns(:devices)).to eq([device])\n#     end\n#   end\n\n#   describe \"GET #show\" do\n#     it \"assigns the requested device as @device\" do\n#       device = Device.create! valid_attributes\n#       get :show, {:id => device.to_param}, valid_session\n#       expect(assigns(:device)).to eq(device)\n#     end\n#   end\n\n#   describe \"GET #new\" do\n#     it \"assigns a new device as @device\" do\n#       get :new, {}, valid_session\n#       expect(assigns(:device)).to be_a_new(Device)\n#     end\n#   end\n\n#   describe \"GET #edit\" do\n#     it \"assigns the requested device as @device\" do\n#       device = Device.create! valid_attributes\n#       get :edit, {:id => device.to_param}, valid_session\n#       expect(assigns(:device)).to eq(device)\n#     end\n#   end\n\n#   describe \"POST #create\" do\n#     context \"with valid params\" do\n#       it \"creates a new Device\" do\n#         expect {\n#           post :create, {:device => valid_attributes}, valid_session\n#         }.to change(Device, :count).by(1)\n#       end\n\n#       it \"assigns a newly created device as @device\" do\n#         post :create, {:device => valid_attributes}, valid_session\n#         expect(assigns(:device)).to be_a(Device)\n#         expect(assigns(:device)).to be_persisted\n#       end\n\n#       it \"redirects to the created device\" do\n#         post :create, {:device => valid_attributes}, valid_session\n#         expect(response).to redirect_to(Device.last)\n#       end\n#     end\n\n#     context \"with invalid params\" do\n#       it \"assigns a newly created but unsaved device as @device\" do\n#         post :create, {:device => invalid_attributes}, valid_session\n#         expect(assigns(:device)).to be_a_new(Device)\n#       end\n\n#       it \"re-renders the 'new' template\" do\n#         post :create, {:device => invalid_attributes}, valid_session\n#         expect(response).to render_template(\"new\")\n#       end\n#     end\n#   end\n\n#   describe \"PUT #update\" do\n#     context \"with valid params\" do\n#       let(:new_attributes) {\n#         skip(\"Add a hash of attributes valid for your model\")\n#       }\n\n#       it \"updates the requested device\" do\n#         device = Device.create! valid_attributes\n#         put :update, {:id => device.to_param, :device => new_attributes}, valid_session\n#         device.reload\n#         skip(\"Add assertions for updated state\")\n#       end\n\n#       it \"assigns the requested device as @device\" do\n#         device = Device.create! valid_attributes\n#         put :update, {:id => device.to_param, :device => valid_attributes}, valid_session\n#         expect(assigns(:device)).to eq(device)\n#       end\n\n#       it \"redirects to the device\" do\n#         device = Device.create! valid_attributes\n#         put :update, {:id => device.to_param, :device => valid_attributes}, valid_session\n#         expect(response).to redirect_to(device)\n#       end\n#     end\n\n#     context \"with invalid params\" do\n#       it \"assigns the device as @device\" do\n#         device = Device.create! valid_attributes\n#         put :update, {:id => device.to_param, :device => invalid_attributes}, valid_session\n#         expect(assigns(:device)).to eq(device)\n#       end\n\n#       it \"re-renders the 'edit' template\" do\n#         device = Device.create! valid_attributes\n#         put :update, {:id => device.to_param, :device => invalid_attributes}, valid_session\n#         expect(response).to render_template(\"edit\")\n#       end\n#     end\n#   end\n\n#   describe \"DELETE #destroy\" do\n#     it \"destroys the requested device\" do\n#       device = Device.create! valid_attributes\n#       expect {\n#         delete :destroy, {:id => device.to_param}, valid_session\n#       }.to change(Device, :count).by(-1)\n#     end\n\n#     it \"redirects to the devices list\" do\n#       device = Device.create! valid_attributes\n#       delete :destroy, {:id => device.to_param}, valid_session\n#       expect(response).to redirect_to(devices_url)\n#     end\n#   end\n\n# end\n"
  },
  {
    "path": "spec/controllers/section_templates_controller_spec.rb",
    "content": "# require 'rails_helper'\n\n# # This spec was generated by rspec-rails when you ran the scaffold generator.\n# # It demonstrates how one might use RSpec to specify the controller code that\n# # was generated by Rails when you ran the scaffold generator.\n# #\n# # It assumes that the implementation code is generated by the rails scaffold\n# # generator.  If you are using any extension libraries to generate different\n# # controller code, this generated spec may or may not pass.\n# #\n# # It only uses APIs available in rails and/or rspec-rails.  There are a number\n# # of tools you can use to make these specs even more expressive, but we're\n# # sticking to rails and rspec-rails APIs to keep things simple and stable.\n# #\n# # Compared to earlier versions of this generator, there is very limited use of\n# # stubs and message expectations in this spec.  Stubs are only used when there\n# # is no simpler way to get a handle on the object needed for the example.\n# # Message expectations are only used when there is no simpler way to specify\n# # that an instance is receiving a specific message.\n\n# RSpec.describe SectionTemplatesController, type: :controller do\n\n#   # This should return the minimal set of attributes required to create a valid\n#   # SectionTemplate. As you add validations to SectionTemplate, be sure to\n#   # adjust the attributes here as well.\n#   let(:valid_attributes) {\n#     skip(\"Add a hash of attributes valid for your model\")\n#   }\n\n#   let(:invalid_attributes) {\n#     skip(\"Add a hash of attributes invalid for your model\")\n#   }\n\n#   # This should return the minimal set of values that should be in the session\n#   # in order to pass any filters (e.g. authentication) defined in\n#   # SectionTemplatesController. Be sure to keep this updated too.\n#   let(:valid_session) { {} }\n\n#   describe \"GET #index\" do\n#     it \"assigns all section_templates as @section_templates\" do\n#       section_template = SectionTemplate.create! valid_attributes\n#       get :index, {}, valid_session\n#       expect(assigns(:section_templates)).to eq([section_template])\n#     end\n#   end\n\n#   describe \"GET #show\" do\n#     it \"assigns the requested section_template as @section_template\" do\n#       section_template = SectionTemplate.create! valid_attributes\n#       get :show, {:id => section_template.to_param}, valid_session\n#       expect(assigns(:section_template)).to eq(section_template)\n#     end\n#   end\n\n#   describe \"GET #new\" do\n#     it \"assigns a new section_template as @section_template\" do\n#       get :new, {}, valid_session\n#       expect(assigns(:section_template)).to be_a_new(SectionTemplate)\n#     end\n#   end\n\n#   describe \"GET #edit\" do\n#     it \"assigns the requested section_template as @section_template\" do\n#       section_template = SectionTemplate.create! valid_attributes\n#       get :edit, {:id => section_template.to_param}, valid_session\n#       expect(assigns(:section_template)).to eq(section_template)\n#     end\n#   end\n\n#   describe \"POST #create\" do\n#     context \"with valid params\" do\n#       it \"creates a new SectionTemplate\" do\n#         expect {\n#           post :create, {:section_template => valid_attributes}, valid_session\n#         }.to change(SectionTemplate, :count).by(1)\n#       end\n\n#       it \"assigns a newly created section_template as @section_template\" do\n#         post :create, {:section_template => valid_attributes}, valid_session\n#         expect(assigns(:section_template)).to be_a(SectionTemplate)\n#         expect(assigns(:section_template)).to be_persisted\n#       end\n\n#       it \"redirects to the created section_template\" do\n#         post :create, {:section_template => valid_attributes}, valid_session\n#         expect(response).to redirect_to(SectionTemplate.last)\n#       end\n#     end\n\n#     context \"with invalid params\" do\n#       it \"assigns a newly created but unsaved section_template as @section_template\" do\n#         post :create, {:section_template => invalid_attributes}, valid_session\n#         expect(assigns(:section_template)).to be_a_new(SectionTemplate)\n#       end\n\n#       it \"re-renders the 'new' template\" do\n#         post :create, {:section_template => invalid_attributes}, valid_session\n#         expect(response).to render_template(\"new\")\n#       end\n#     end\n#   end\n\n#   describe \"PUT #update\" do\n#     context \"with valid params\" do\n#       let(:new_attributes) {\n#         skip(\"Add a hash of attributes valid for your model\")\n#       }\n\n#       it \"updates the requested section_template\" do\n#         section_template = SectionTemplate.create! valid_attributes\n#         put :update, {:id => section_template.to_param, :section_template => new_attributes}, valid_session\n#         section_template.reload\n#         skip(\"Add assertions for updated state\")\n#       end\n\n#       it \"assigns the requested section_template as @section_template\" do\n#         section_template = SectionTemplate.create! valid_attributes\n#         put :update, {:id => section_template.to_param, :section_template => valid_attributes}, valid_session\n#         expect(assigns(:section_template)).to eq(section_template)\n#       end\n\n#       it \"redirects to the section_template\" do\n#         section_template = SectionTemplate.create! valid_attributes\n#         put :update, {:id => section_template.to_param, :section_template => valid_attributes}, valid_session\n#         expect(response).to redirect_to(section_template)\n#       end\n#     end\n\n#     context \"with invalid params\" do\n#       it \"assigns the section_template as @section_template\" do\n#         section_template = SectionTemplate.create! valid_attributes\n#         put :update, {:id => section_template.to_param, :section_template => invalid_attributes}, valid_session\n#         expect(assigns(:section_template)).to eq(section_template)\n#       end\n\n#       it \"re-renders the 'edit' template\" do\n#         section_template = SectionTemplate.create! valid_attributes\n#         put :update, {:id => section_template.to_param, :section_template => invalid_attributes}, valid_session\n#         expect(response).to render_template(\"edit\")\n#       end\n#     end\n#   end\n\n#   describe \"DELETE #destroy\" do\n#     it \"destroys the requested section_template\" do\n#       section_template = SectionTemplate.create! valid_attributes\n#       expect {\n#         delete :destroy, {:id => section_template.to_param}, valid_session\n#       }.to change(SectionTemplate, :count).by(-1)\n#     end\n\n#     it \"redirects to the section_templates list\" do\n#       section_template = SectionTemplate.create! valid_attributes\n#       delete :destroy, {:id => section_template.to_param}, valid_session\n#       expect(response).to redirect_to(section_templates_url)\n#     end\n#   end\n\n# end\n"
  },
  {
    "path": "spec/controllers/sections_controller_spec.rb",
    "content": "# require 'rails_helper'\n\n# # This spec was generated by rspec-rails when you ran the scaffold generator.\n# # It demonstrates how one might use RSpec to specify the controller code that\n# # was generated by Rails when you ran the scaffold generator.\n# #\n# # It assumes that the implementation code is generated by the rails scaffold\n# # generator.  If you are using any extension libraries to generate different\n# # controller code, this generated spec may or may not pass.\n# #\n# # It only uses APIs available in rails and/or rspec-rails.  There are a number\n# # of tools you can use to make these specs even more expressive, but we're\n# # sticking to rails and rspec-rails APIs to keep things simple and stable.\n# #\n# # Compared to earlier versions of this generator, there is very limited use of\n# # stubs and message expectations in this spec.  Stubs are only used when there\n# # is no simpler way to get a handle on the object needed for the example.\n# # Message expectations are only used when there is no simpler way to specify\n# # that an instance is receiving a specific message.\n\n# RSpec.describe SectionsController, type: :controller do\n\n#   # This should return the minimal set of attributes required to create a valid\n#   # Section. As you add validations to Section, be sure to\n#   # adjust the attributes here as well.\n#   let(:valid_attributes) {\n#     skip(\"Add a hash of attributes valid for your model\")\n#   }\n\n#   let(:invalid_attributes) {\n#     skip(\"Add a hash of attributes invalid for your model\")\n#   }\n\n#   # This should return the minimal set of values that should be in the session\n#   # in order to pass any filters (e.g. authentication) defined in\n#   # SectionsController. Be sure to keep this updated too.\n#   let(:valid_session) { {} }\n\n#   describe \"GET #index\" do\n#     it \"assigns all sections as @sections\" do\n#       section = Section.create! valid_attributes\n#       get :index, {}, valid_session\n#       expect(assigns(:sections)).to eq([section])\n#     end\n#   end\n\n#   describe \"GET #show\" do\n#     it \"assigns the requested section as @section\" do\n#       section = Section.create! valid_attributes\n#       get :show, {:id => section.to_param}, valid_session\n#       expect(assigns(:section)).to eq(section)\n#     end\n#   end\n\n#   describe \"GET #new\" do\n#     it \"assigns a new section as @section\" do\n#       get :new, {}, valid_session\n#       expect(assigns(:section)).to be_a_new(Section)\n#     end\n#   end\n\n#   describe \"GET #edit\" do\n#     it \"assigns the requested section as @section\" do\n#       section = Section.create! valid_attributes\n#       get :edit, {:id => section.to_param}, valid_session\n#       expect(assigns(:section)).to eq(section)\n#     end\n#   end\n\n#   describe \"POST #create\" do\n#     context \"with valid params\" do\n#       it \"creates a new Section\" do\n#         expect {\n#           post :create, {:section => valid_attributes}, valid_session\n#         }.to change(Section, :count).by(1)\n#       end\n\n#       it \"assigns a newly created section as @section\" do\n#         post :create, {:section => valid_attributes}, valid_session\n#         expect(assigns(:section)).to be_a(Section)\n#         expect(assigns(:section)).to be_persisted\n#       end\n\n#       it \"redirects to the created section\" do\n#         post :create, {:section => valid_attributes}, valid_session\n#         expect(response).to redirect_to(Section.last)\n#       end\n#     end\n\n#     context \"with invalid params\" do\n#       it \"assigns a newly created but unsaved section as @section\" do\n#         post :create, {:section => invalid_attributes}, valid_session\n#         expect(assigns(:section)).to be_a_new(Section)\n#       end\n\n#       it \"re-renders the 'new' template\" do\n#         post :create, {:section => invalid_attributes}, valid_session\n#         expect(response).to render_template(\"new\")\n#       end\n#     end\n#   end\n\n#   describe \"PUT #update\" do\n#     context \"with valid params\" do\n#       let(:new_attributes) {\n#         skip(\"Add a hash of attributes valid for your model\")\n#       }\n\n#       it \"updates the requested section\" do\n#         section = Section.create! valid_attributes\n#         put :update, {:id => section.to_param, :section => new_attributes}, valid_session\n#         section.reload\n#         skip(\"Add assertions for updated state\")\n#       end\n\n#       it \"assigns the requested section as @section\" do\n#         section = Section.create! valid_attributes\n#         put :update, {:id => section.to_param, :section => valid_attributes}, valid_session\n#         expect(assigns(:section)).to eq(section)\n#       end\n\n#       it \"redirects to the section\" do\n#         section = Section.create! valid_attributes\n#         put :update, {:id => section.to_param, :section => valid_attributes}, valid_session\n#         expect(response).to redirect_to(section)\n#       end\n#     end\n\n#     context \"with invalid params\" do\n#       it \"assigns the section as @section\" do\n#         section = Section.create! valid_attributes\n#         put :update, {:id => section.to_param, :section => invalid_attributes}, valid_session\n#         expect(assigns(:section)).to eq(section)\n#       end\n\n#       it \"re-renders the 'edit' template\" do\n#         section = Section.create! valid_attributes\n#         put :update, {:id => section.to_param, :section => invalid_attributes}, valid_session\n#         expect(response).to render_template(\"edit\")\n#       end\n#     end\n#   end\n\n#   describe \"DELETE #destroy\" do\n#     it \"destroys the requested section\" do\n#       section = Section.create! valid_attributes\n#       expect {\n#         delete :destroy, {:id => section.to_param}, valid_session\n#       }.to change(Section, :count).by(-1)\n#     end\n\n#     it \"redirects to the sections list\" do\n#       section = Section.create! valid_attributes\n#       delete :destroy, {:id => section.to_param}, valid_session\n#       expect(response).to redirect_to(sections_url)\n#     end\n#   end\n\n# end\n"
  },
  {
    "path": "spec/controllers/units_controller_spec.rb",
    "content": "# require 'rails_helper'\n\n# # This spec was generated by rspec-rails when you ran the scaffold generator.\n# # It demonstrates how one might use RSpec to specify the controller code that\n# # was generated by Rails when you ran the scaffold generator.\n# #\n# # It assumes that the implementation code is generated by the rails scaffold\n# # generator.  If you are using any extension libraries to generate different\n# # controller code, this generated spec may or may not pass.\n# #\n# # It only uses APIs available in rails and/or rspec-rails.  There are a number\n# # of tools you can use to make these specs even more expressive, but we're\n# # sticking to rails and rspec-rails APIs to keep things simple and stable.\n# #\n# # Compared to earlier versions of this generator, there is very limited use of\n# # stubs and message expectations in this spec.  Stubs are only used when there\n# # is no simpler way to get a handle on the object needed for the example.\n# # Message expectations are only used when there is no simpler way to specify\n# # that an instance is receiving a specific message.\n\n# RSpec.describe UnitsController, type: :controller do\n\n#   # This should return the minimal set of attributes required to create a valid\n#   # Unit. As you add validations to Unit, be sure to\n#   # adjust the attributes here as well.\n#   let(:valid_attributes) {\n#     skip(\"Add a hash of attributes valid for your model\")\n#   }\n\n#   let(:invalid_attributes) {\n#     skip(\"Add a hash of attributes invalid for your model\")\n#   }\n\n#   # This should return the minimal set of values that should be in the session\n#   # in order to pass any filters (e.g. authentication) defined in\n#   # UnitsController. Be sure to keep this updated too.\n#   let(:valid_session) { {} }\n\n#   describe \"GET #index\" do\n#     it \"assigns all units as @units\" do\n#       unit = Unit.create! valid_attributes\n#       get :index, {}, valid_session\n#       expect(assigns(:units)).to eq([unit])\n#     end\n#   end\n\n#   describe \"GET #show\" do\n#     it \"assigns the requested unit as @unit\" do\n#       unit = Unit.create! valid_attributes\n#       get :show, {:id => unit.to_param}, valid_session\n#       expect(assigns(:unit)).to eq(unit)\n#     end\n#   end\n\n#   describe \"GET #new\" do\n#     it \"assigns a new unit as @unit\" do\n#       get :new, {}, valid_session\n#       expect(assigns(:unit)).to be_a_new(Unit)\n#     end\n#   end\n\n#   describe \"GET #edit\" do\n#     it \"assigns the requested unit as @unit\" do\n#       unit = Unit.create! valid_attributes\n#       get :edit, {:id => unit.to_param}, valid_session\n#       expect(assigns(:unit)).to eq(unit)\n#     end\n#   end\n\n#   describe \"POST #create\" do\n#     context \"with valid params\" do\n#       it \"creates a new Unit\" do\n#         expect {\n#           post :create, {:unit => valid_attributes}, valid_session\n#         }.to change(Unit, :count).by(1)\n#       end\n\n#       it \"assigns a newly created unit as @unit\" do\n#         post :create, {:unit => valid_attributes}, valid_session\n#         expect(assigns(:unit)).to be_a(Unit)\n#         expect(assigns(:unit)).to be_persisted\n#       end\n\n#       it \"redirects to the created unit\" do\n#         post :create, {:unit => valid_attributes}, valid_session\n#         expect(response).to redirect_to(Unit.last)\n#       end\n#     end\n\n#     context \"with invalid params\" do\n#       it \"assigns a newly created but unsaved unit as @unit\" do\n#         post :create, {:unit => invalid_attributes}, valid_session\n#         expect(assigns(:unit)).to be_a_new(Unit)\n#       end\n\n#       it \"re-renders the 'new' template\" do\n#         post :create, {:unit => invalid_attributes}, valid_session\n#         expect(response).to render_template(\"new\")\n#       end\n#     end\n#   end\n\n#   describe \"PUT #update\" do\n#     context \"with valid params\" do\n#       let(:new_attributes) {\n#         skip(\"Add a hash of attributes valid for your model\")\n#       }\n\n#       it \"updates the requested unit\" do\n#         unit = Unit.create! valid_attributes\n#         put :update, {:id => unit.to_param, :unit => new_attributes}, valid_session\n#         unit.reload\n#         skip(\"Add assertions for updated state\")\n#       end\n\n#       it \"assigns the requested unit as @unit\" do\n#         unit = Unit.create! valid_attributes\n#         put :update, {:id => unit.to_param, :unit => valid_attributes}, valid_session\n#         expect(assigns(:unit)).to eq(unit)\n#       end\n\n#       it \"redirects to the unit\" do\n#         unit = Unit.create! valid_attributes\n#         put :update, {:id => unit.to_param, :unit => valid_attributes}, valid_session\n#         expect(response).to redirect_to(unit)\n#       end\n#     end\n\n#     context \"with invalid params\" do\n#       it \"assigns the unit as @unit\" do\n#         unit = Unit.create! valid_attributes\n#         put :update, {:id => unit.to_param, :unit => invalid_attributes}, valid_session\n#         expect(assigns(:unit)).to eq(unit)\n#       end\n\n#       it \"re-renders the 'edit' template\" do\n#         unit = Unit.create! valid_attributes\n#         put :update, {:id => unit.to_param, :unit => invalid_attributes}, valid_session\n#         expect(response).to render_template(\"edit\")\n#       end\n#     end\n#   end\n\n#   describe \"DELETE #destroy\" do\n#     it \"destroys the requested unit\" do\n#       unit = Unit.create! valid_attributes\n#       expect {\n#         delete :destroy, {:id => unit.to_param}, valid_session\n#       }.to change(Unit, :count).by(-1)\n#     end\n\n#     it \"redirects to the units list\" do\n#       unit = Unit.create! valid_attributes\n#       delete :destroy, {:id => unit.to_param}, valid_session\n#       expect(response).to redirect_to(units_url)\n#     end\n#   end\n\n# end\n"
  },
  {
    "path": "spec/factories/captures.rb",
    "content": "FactoryGirl.define do\n  factory :capture do\n    unit_id 1\n    device_id 1\n    name \"MyString\"\n    notes \"MyText\"\n    binary \"MyText\"\n    original_binary \"MyText\"\n  end\nend\n"
  },
  {
    "path": "spec/factories/devices.rb",
    "content": "FactoryGirl.define do\n  factory :device do\n    fcc_id \"MyString\"\n    baudrate \"MyString\"\n    frequency 1.5\n    modulation \"MyString\"\n    encoding \"MyString\"\n    name \"MyString\"\n    notes \"MyText\"\n  end\nend\n"
  },
  {
    "path": "spec/factories/section_templates.rb",
    "content": "FactoryGirl.define do\n  factory :section_template do\n    name \"MyString\"\n    sections \"MyText\"\n    added_by \"MyString\"\n  end\nend\n"
  },
  {
    "path": "spec/factories/sections.rb",
    "content": "FactoryGirl.define do\n  factory :section do\n    device_id 1\n    name \"MyString\"\n    notes \"MyString\"\n    start_pos 1\n    end_pos 1\n    colour \"MyString\"\n  end\nend\n"
  },
  {
    "path": "spec/factories/units.rb",
    "content": "FactoryGirl.define do\n  factory :unit do\n    device_id 1\n    name \"MyString\"\n    notes \"MyText\"\n  end\nend\n"
  },
  {
    "path": "spec/helpers/captures_helper_spec.rb",
    "content": "require 'rails_helper'\n\n# Specs in this file have access to a helper object that includes\n# the CapturesHelper. For example:\n#\n# describe CapturesHelper do\n#   describe \"string concat\" do\n#     it \"concats two strings with spaces\" do\n#       expect(helper.concat_strings(\"this\",\"that\")).to eq(\"this that\")\n#     end\n#   end\n# end\nRSpec.describe CapturesHelper, type: :helper do\n  pending \"add some examples to (or delete) #{__FILE__}\"\nend\n"
  },
  {
    "path": "spec/helpers/devices_helper_spec.rb",
    "content": "require 'rails_helper'\n\n# Specs in this file have access to a helper object that includes\n# the DevicesHelper. For example:\n#\n# describe DevicesHelper do\n#   describe \"string concat\" do\n#     it \"concats two strings with spaces\" do\n#       expect(helper.concat_strings(\"this\",\"that\")).to eq(\"this that\")\n#     end\n#   end\n# end\nRSpec.describe DevicesHelper, type: :helper do\n  pending \"add some examples to (or delete) #{__FILE__}\"\nend\n"
  },
  {
    "path": "spec/helpers/section_templates_helper_spec.rb",
    "content": "require 'rails_helper'\n\n# Specs in this file have access to a helper object that includes\n# the SectionTemplatesHelper. For example:\n#\n# describe SectionTemplatesHelper do\n#   describe \"string concat\" do\n#     it \"concats two strings with spaces\" do\n#       expect(helper.concat_strings(\"this\",\"that\")).to eq(\"this that\")\n#     end\n#   end\n# end\nRSpec.describe SectionTemplatesHelper, type: :helper do\n  pending \"add some examples to (or delete) #{__FILE__}\"\nend\n"
  },
  {
    "path": "spec/helpers/sections_helper_spec.rb",
    "content": "require 'rails_helper'\n\n# Specs in this file have access to a helper object that includes\n# the SectionsHelper. For example:\n#\n# describe SectionsHelper do\n#   describe \"string concat\" do\n#     it \"concats two strings with spaces\" do\n#       expect(helper.concat_strings(\"this\",\"that\")).to eq(\"this that\")\n#     end\n#   end\n# end\nRSpec.describe SectionsHelper, type: :helper do\n  pending \"add some examples to (or delete) #{__FILE__}\"\nend\n"
  },
  {
    "path": "spec/helpers/units_helper_spec.rb",
    "content": "require 'rails_helper'\n\n# Specs in this file have access to a helper object that includes\n# the UnitsHelper. For example:\n#\n# describe UnitsHelper do\n#   describe \"string concat\" do\n#     it \"concats two strings with spaces\" do\n#       expect(helper.concat_strings(\"this\",\"that\")).to eq(\"this that\")\n#     end\n#   end\n# end\nRSpec.describe UnitsHelper, type: :helper do\n  pending \"add some examples to (or delete) #{__FILE__}\"\nend\n"
  },
  {
    "path": "spec/models/capture_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe Capture, type: :model do  \n\tsubject { described_class.new }\n\n\n\t######################\n\t# General\n\t######################\n\n\tit \"flips the binary\" do\n\t\texpect(subject.flip(\"1111000011110000\")).to eq(\"0000111100001111\")\n\tend\n\n\n\tit \"transforms binary to hexcode\" \n\tit \"transforms arbitrarily supplied binary to hexcode\"\n\tit \"transforms binary to ascii\"\n\tit \"transforms arbitrarily supplied binary to ascii\"\n\n\n\tdescribe \"Associations\" do\n\t\tit { should belong_to(:device) }\n\t\tit { should belong_to(:unit) }\n\tend\n\n\n\n\t######################\n\t# PWM 6633\n\t######################\n\n\tdescribe \"Invalid PWM 66/33\" do \n\t  \tsubject { described_class.new(binary: \"1100100011001000\",original_binary: \"1100100011001000\") }\n\t\tit \"is reported as invalid\" do\n      \t\texpect(subject.valid_pwm?).to eq(false)\n\t\tend\n\tend\n\n\tdescribe \"Valid PWM 66/33\" do \n  \t    let(:device) { Device.create(name: \"name\")  }\n  \t    let(:unit) { Unit.create(name: \"name\", device_id: device.id)  }\n\t  \tsubject { described_class.new(binary: \"110100110100\",original_binary: \"110100110100\", device_id: device.id, unit_id: unit.id) }\n\t\tit \"is reported as valid\" do\n      \t\texpect(subject.valid_pwm?).to eq(true)\n\t\tend\n\t\tit \"decodes PWM 66/33\" do \n      \t\texpect(subject.pwm_decode).to eq(\"1010\")\n\t\tend\n\tend\n\n\tdescribe \"Incomplete PWM 66/33\" do \n\t  \tsubject { described_class.new(binary: \"1101001101\",original_binary: \"1101001101\") }\n\t\tit \"is padded with 0s and saved\" do\n      \t\texpect(subject.valid_pwm?).to eq(true)\n\t\tend\n\tend\n\n\n\tdescribe \"Incomplete PWM 66/33\" do \n\t  \tsubject { described_class.new(binary: \"1101001101\",original_binary: \"1101001101\") }\n\t\tit \"is padded with 0s and saved with message for human on first reload\" do\n      \t\texpect(subject.valid_pwm?(true)).to eq(\"This was valid PWM but significant whitespace at the end was missed by you. I have added 0s to the end and saved the change.\")\n\t\tend\n\tend\n\n\n\tdescribe \"Incomplete PWM 66/33\" do \n\t  \tsubject { described_class.new(binary: \"1101001101\",original_binary: \"1101001101\") }\n\t\tit \"should return as valid on second reload\" do\n      \t\tsubject.valid_pwm?(true)\n      \t\texpect(subject.valid_pwm?(true)).to eq(\"Yes\")\n\t\tend\n\tend\n\n  \tdescribe \"Shifted Dr Nick Edge case PWM 66/33\" do\n  \t\tsubject { described_class.new(binary: \"0110100110100\",original_binary: \"0110100110100\") }\n  \t\tit \"should detect and correct shift\" do\n      \t\texpect(subject.valid_pwm?(true)).to eq(\"This is likely to be a PWM capture but there was an unexpected '0' at the beginning which suggests the last cell was also chopped off. It is STRONGLY recommended that you re-create this capture but this time start one cell later, and add an extra cell at the end even if it is empty. This is an edge-case that seems to occur rarely with rtl-sdr captures. We don't know why exactly.\")\n  \t\tend\n  \tend\n\n\n\t######################\n\t# PWM 7725\n\t######################\n\n\tdescribe \"Invalid PWM 75/25\" do \n\t  \tsubject { described_class.new(binary: \"110100110100\",original_binary: \"110100110100\") }\n\t\tit \"is reported as invalid\" do\n      \t\texpect(subject.valid_pwm_7525?).to eq(false)\n\t\tend\n\tend\n\n\tdescribe \"Valid PWM 75/25\" do \n  \t    let(:device) { Device.create(name: \"name\")  }\n  \t    let(:unit) { Unit.create(name: \"name\", device_id: device.id)  }\n\t  \tsubject { described_class.new(binary: \"1110100011101000\",original_binary: \"1110100011101000\", device_id: device.id, unit_id: unit.id) }\n\n\t\tit \"is reported as valid\" do\n      \t\texpect(subject.valid_pwm_7525?).to eq(true)\n\t\tend\n\t\tit \"decodes PWM 75/25\" do\n      \t\texpect(subject.pwm_decode_7525).to eq(\"1010\")\n\t\tend\n\tend\n\n\n\tdescribe \"Incomplete PWM 75/25\" do \n\t  \tsubject { described_class.new(binary: \"11101000111010\",original_binary: \"11101000111010\") }\n\t\tit \"is padded with 0s and saved\" do\n      \t\texpect(subject.valid_pwm_7525?).to eq(true)\n\t\tend\n\tend\n\n\n\tdescribe \"Incomplete PWM 75/25\" do \n\t  \tsubject { described_class.new(binary: \"11101000111010\",original_binary: \"11101000111010\") }\n\t\tit \"is padded with 0s and saved with message for human on first reload\" do\n      \t\texpect(subject.valid_pwm_7525?(true)).to eq(\"This was valid PWM but significant whitespace at the end was missed by you. I have added 0s to the end and saved the change.\")\n\t\tend\n\tend\n\n\n\tdescribe \"Incomplete PWM 75/25\" do \n\t  \tsubject { described_class.new(binary: \"11101000111010\",original_binary: \"11101000111010\") }\n\t\tit \"should return as valid on second reload\" do\n      \t\tsubject.valid_pwm_7525?(true)\n      \t\texpect(subject.valid_pwm_7525?(true)).to eq(\"Yes\")\n\t\tend\n\tend\n\n\n  \tdescribe \"Shifted Dr Nick Edge case PWM 75/25\" do\n  \t\tsubject { described_class.new(binary: \"01000111010001110\",original_binary: \"01000111010001110\") }\n  \t\tit \"should detect and correct shift\" do\n      \t\texpect(subject.valid_pwm_7525?(true)).to eq(\"This is likely to be a PWM capture but there was an unexpected '0' at the beginning which suggests the last cell was also chopped off. It is STRONGLY recommended that you re-create this capture but this time start one cell later, and add an extra cell at the end even if it is empty. This is an edge-case that seems to occur rarely with rtl-sdr captures. We don't know why exactly.\")\n  \t\tend\n  \tend\n  \n\n\n\t######################\n\t# Manchester\n\t######################\n\n\tdescribe \"well-aligned, valid, manchester\" do\n  \t\tsubject { described_class.new(binary: \"1010010110100101\",original_binary: \"1010010110100101\") }\n\t\tit \"is reported as valid\" do\n      \t\texpect(subject.valid_manchester?).to eq(true)\n\t\tend\n\tend\n\n\n\tdescribe \"off-by-one/poorly aligned, valid, manchester\" do\n  \t\tsubject { described_class.new(binary: \"101011001101001\",original_binary: \"101011001101001\") }\n\t\tit \"is reported as valid\" do\n      \t\texpect(subject.valid_manchester?(true)).to eq(\"\\n If you add a 0 at the start it is... re-capture the signal with an empty cell at the beginning\")\n\t\tend\n\tend\n\n\tdescribe \"manchester\" do\n  \t\tsubject { described_class.new(binary: \"1010010110100101\",original_binary: \"1010010110100101\") }\n\t\tit \"is decoded\" do\n      \t\texpect(subject.manchester_decode).to eq(\"11001100\") \n\t\tend\n\tend\nend\n"
  },
  {
    "path": "spec/models/device_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe Device, type: :model do\n\t######################\n\t# General\n\t######################\n\n\n\tdescribe \"Associations\" do\n\t\tit { should have_many(:units) }\n\t\tit { should have_many(:captures) }\n\t\tit { should have_many(:sections) }\n\tend\n\n\tdescribe \"format frequency\" do \n\t  \tsubject { described_class.create(name:'device name', frequency: 433.0) }\n\t\tit \"correctly formats 433 mhz\" do\n\t\t\texpect(subject.format_frequency).to eq(\"433000000\")\n\t\tend\n\tend\n\n\tdescribe \"format frequency\" do \n\t  \tsubject { described_class.create(name:'device name', frequency: 1433.0) }\n\t\tit \"correctly formats 1.433 ghz\" do\n\t\t\texpect(subject.format_frequency).to eq(\"1433000000\")\n\t\tend\n\tend\n\n\tdescribe \"format frequency\" do \n\t  \tsubject { described_class.create(name:'device name', frequency: 43.0) }\n\t\tit \"correctly formats 43 mhz\" do\n\t\t\texpect(subject.format_frequency).to eq(\"43000000\")\n\t\tend\n\tend\n\n\tdescribe \"sharing templates\" do \n\t  \tsubject { described_class.create(name:'device name') }\n\t\tit \"correctly exports sections as csv\" do\n\t\t\tsection = Section.create(name: \"name\", start_pos: 0, end_pos: 15, colour: 'blue', notes: 'none', device_id: subject.id)  \n\t\t\tsubject.sections_to_csv('template','nobody')\n\t\t\texpect(`cat #{Rails.root.join('mcs', 'contribution.md').to_s}`).to eq(\"```ruby\\nSectionTemplate.find_or_create_by(:name => \\\"template\\\") do |st|\\n  st.sections = \\\"name,start_pos,end_pos,colour,notes\\nname,0,15,blue,none\\n\\\" \\n  st.added_by = 'nobody' \\nend\\n```\\n\")\n\t\tend\n\tend\n\n\t######################\n\t# Update Modulation\n\t######################\n\n\tdescribe \"update modulation\" do \n\t  \tsubject { described_class.create(name:'device name') }\n\t\tit \"correctly updates as PWM 6633\" do\n\t\t\tunit = Unit.create(name: \"name\", device_id: subject.id)  \n\t\t\tcapture = Capture.create(binary: \"110100100\",original_binary: \"110100100\", name: \"name\", device_id: subject.id, unit_id: unit.id)  \n\t\t\tsubject.update_modulation\n      \t\texpect(subject.modulation).to eq(\"PWM\")\n      \t\texpect(subject.encoding).to eq(\"66/33\")\n\t\tend\n\tend\n\tdescribe \"update modulation\" do \n\t  \tsubject { described_class.create(name:'device name') }\n\t\tit \"correctly updates as PWM 7525\" do\n\t\t\tunit = Unit.create(name: \"name\", device_id: subject.id)  \n\t\t\tcapture = Capture.create(binary: \"1110100011101000\",original_binary: \"1110100011101000\", name: \"name\", device_id: subject.id, unit_id: unit.id)  \n\t\t\tsubject.update_modulation\n      \t\texpect(subject.modulation).to eq(\"PWM\")\n      \t\texpect(subject.encoding).to eq(\"75/25\")\n\t\tend\n\tend\n\tdescribe \"update modulation\" do \n\t  \tsubject { described_class.create(name:'device name') }\n\t\tit \"correctly updates as Manchester\" do\n\t\t\tunit = Unit.create(name: \"name\", device_id: subject.id)  \n\t\t\tcapture = Capture.create(binary: \"10100101\",original_binary: \"10100101\", name: \"name\", device_id: subject.id, unit_id: unit.id)  \n\t\t\tsubject.update_modulation\n      \t\texpect(subject.modulation).to eq(\"OOK\")\n      \t\texpect(subject.encoding).to eq(\"Manchester\")\n\t\tend\n\tend\n\tdescribe \"update modulation\" do \n\t  \tsubject { described_class.create(name:'device name') }\n\t\tit \"correctly updates as OOK if nothing else\" do\n\t\t\tunit = Unit.create(name: \"name\", device_id: subject.id)  \n\t\t\tcapture = Capture.create(binary: \"1111001010111\",original_binary: \"1111001010111\", name: \"name\", device_id: subject.id, unit_id: unit.id)  \n\t\t\tsubject.update_modulation\n      \t\texpect(subject.modulation).to eq(\"OOK\")\n      \t\texpect(subject.encoding).to eq(\"n/a\")\n\t\tend\n\tend\n\tdescribe \"update modulation\" do \n\t  \tsubject { described_class.create(name:'device name', modulation: \"OOK\", encoding: \"n/a\") }\n\t\tit \"is run if encoding and modulation match our OOK update\" do\n\t\t\tunit = Unit.create(name: \"name\", device_id: subject.id)  \n\t\t\tcapture = Capture.create(binary: \"10100101\",original_binary: \"10100101\", name: \"name\", device_id: subject.id, unit_id: unit.id)  \n\t\t\tsubject.update_modulation\n      \t\texpect(subject.modulation).to eq(\"OOK\")\n      \t\texpect(subject.encoding).to eq(\"Manchester\")\n\t\tend\n\tend\n\tdescribe \"update modulation\" do \n\t  \tsubject { described_class.create(name:'device name', modulation: \"ASK\", encoding: \"Foobar\") }\n\t\tit \"should not run if encoding and modulation are custom\" do\n\t\t\tunit = Unit.create(name: \"name\", device_id: subject.id)  \n\t\t\tcapture = Capture.create(binary: \"10100101\",original_binary: \"10100101\", name: \"name\", device_id: subject.id, unit_id: unit.id)  \n\t\t\tsubject.update_modulation\n      \t\texpect(subject.modulation).to eq(\"ASK\")\n      \t\texpect(subject.encoding).to eq(\"Foobar\")\n\t\tend\n\tend\n\nend\n"
  },
  {
    "path": "spec/models/section_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe Section, type: :model do\n\tdescribe \"Associations\" do\n\t\tit { should belong_to(:device) }\n\tend\n\n\tdescribe \"section range\" do \n\t  \tsubject { described_class.create(name:'section name', start_pos: 0, end_pos: 16) }\n\t\tit \"correctly returns range object\" do\n\t\t\texpect(subject.section_range).to eq(0..16)\n\t\tend\n\tend\nend\n"
  },
  {
    "path": "spec/models/section_template_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe SectionTemplate, type: :model do\n  #pending \"add some examples to (or delete) #{__FILE__}\"\nend\n"
  },
  {
    "path": "spec/models/unit_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe Unit, type: :model do\n  #pending \"add some examples to (or delete) #{__FILE__}\"\nend\n"
  },
  {
    "path": "spec/rails_helper.rb",
    "content": "# This file is copied to spec/ when you run 'rails generate rspec:install'\nENV['RAILS_ENV'] ||= 'test'\nrequire File.expand_path('../../config/environment', __FILE__)\n# Prevent database truncation if the environment is production\nabort(\"The Rails environment is running in production mode!\") if Rails.env.production?\nrequire 'spec_helper'\nrequire 'rspec/rails'\n# Add additional requires below this line. Rails is not loaded until this point!\n\n# Requires supporting ruby files with custom matchers and macros, etc, in\n# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are\n# run as spec files by default. This means that files in spec/support that end\n# in _spec.rb will both be required and run as specs, causing the specs to be\n# run twice. It is recommended that you do not name files matching this glob to\n# end with _spec.rb. You can configure this pattern with the --pattern\n# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.\n#\n# The following line is provided for convenience purposes. It has the downside\n# of increasing the boot-up time by auto-requiring all files in the support\n# directory. Alternatively, in the individual `*_spec.rb` files, manually\n# require only the support files necessary.\n#\n# Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }\n\n# Checks for pending migration and applies them before tests are run.\n# If you are not using ActiveRecord, you can remove this line.\nActiveRecord::Migration.maintain_test_schema!\n\nRSpec.configure do |config|\n  # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures\n  config.fixture_path = \"#{::Rails.root}/spec/fixtures\"\n\n  # If you're not using ActiveRecord, or you'd prefer not to run each of your\n  # examples within a transaction, remove the following line or assign false\n  # instead of true.\n  config.use_transactional_fixtures = true\n\n  # RSpec Rails can automatically mix in different behaviours to your tests\n  # based on their file location, for example enabling you to call `get` and\n  # `post` in specs under `spec/controllers`.\n  #\n  # You can disable this behaviour by removing the line below, and instead\n  # explicitly tag your specs with their type, e.g.:\n  #\n  #     RSpec.describe UsersController, :type => :controller do\n  #       # ...\n  #     end\n  #\n  # The different available types are documented in the features, such as in\n  # https://relishapp.com/rspec/rspec-rails/docs\n  config.infer_spec_type_from_file_location!\n\n  # Filter lines from Rails gems in backtraces.\n  config.filter_rails_from_backtrace!\n  # arbitrary gems may also be filtered via:\n  # config.filter_gems_from_backtrace(\"gem name\")\nend\n\n\n"
  },
  {
    "path": "spec/requests/captures_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"Captures\", type: :request do\n  describe \"GET /captures without authenticating\" do\n    it \"redirects the user\" do\n      get captures_path\n      expect(response).to have_http_status(302)\n    end\n  end\nend\n"
  },
  {
    "path": "spec/requests/devices_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"Devices\", type: :request do\n  describe \"GET /devices without authenticating\" do\n    it \"redirects the user\" do\n      get devices_path\n      expect(response).to have_http_status(302)\n    end\n  end\nend\n"
  },
  {
    "path": "spec/requests/section_templates_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"SectionTemplates\", type: :request do\n  describe \"GET /section_templates without authenticating\" do\n    it \"redirects the user\" do\n      get section_templates_path\n      expect(response).to have_http_status(302)\n    end\n  end\nend\n"
  },
  {
    "path": "spec/requests/sections_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"Sections\", type: :request do\n  describe \"GET /sections without authenticating\" do\n    it \"redirects the user\" do\n      get sections_path\n      expect(response).to have_http_status(302)\n    end\n  end\nend\n"
  },
  {
    "path": "spec/requests/units_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"Units\", type: :request do\n  describe \"GET /units without authenticating\" do\n    it \"redirects the user\" do\n      get units_path\n      expect(response).to have_http_status(302)\n    end\n  end\nend\n"
  },
  {
    "path": "spec/routing/captures_routing_spec.rb",
    "content": "require \"rails_helper\"\n\nRSpec.describe CapturesController, type: :routing do\n  describe \"routing\" do\n\n    it \"routes to #index\" do\n      expect(:get => \"/captures\").to route_to(\"captures#index\")\n    end\n\n    it \"routes to #new\" do\n      expect(:get => \"/captures/new\").to route_to(\"captures#new\")\n    end\n\n    it \"routes to #show\" do\n      expect(:get => \"/captures/1\").to route_to(\"captures#show\", :id => \"1\")\n    end\n\n    it \"routes to #edit\" do\n      expect(:get => \"/captures/1/edit\").to route_to(\"captures#edit\", :id => \"1\")\n    end\n\n    it \"routes to #create\" do\n      expect(:post => \"/captures\").to route_to(\"captures#create\")\n    end\n\n    it \"routes to #update via PUT\" do\n      expect(:put => \"/captures/1\").to route_to(\"captures#update\", :id => \"1\")\n    end\n\n    it \"routes to #update via PATCH\" do\n      expect(:patch => \"/captures/1\").to route_to(\"captures#update\", :id => \"1\")\n    end\n\n    it \"routes to #destroy\" do\n      expect(:delete => \"/captures/1\").to route_to(\"captures#destroy\", :id => \"1\")\n    end\n\n  end\nend\n"
  },
  {
    "path": "spec/routing/devices_routing_spec.rb",
    "content": "require \"rails_helper\"\n\nRSpec.describe DevicesController, type: :routing do\n  describe \"routing\" do\n\n    it \"routes to #index\" do\n      expect(:get => \"/devices\").to route_to(\"devices#index\")\n    end\n\n    it \"routes to #new\" do\n      expect(:get => \"/devices/new\").to route_to(\"devices#new\")\n    end\n\n    it \"routes to #show\" do\n      expect(:get => \"/devices/1\").to route_to(\"devices#show\", :id => \"1\")\n    end\n\n    it \"routes to #edit\" do\n      expect(:get => \"/devices/1/edit\").to route_to(\"devices#edit\", :id => \"1\")\n    end\n\n    it \"routes to #create\" do\n      expect(:post => \"/devices\").to route_to(\"devices#create\")\n    end\n\n    it \"routes to #update via PUT\" do\n      expect(:put => \"/devices/1\").to route_to(\"devices#update\", :id => \"1\")\n    end\n\n    it \"routes to #update via PATCH\" do\n      expect(:patch => \"/devices/1\").to route_to(\"devices#update\", :id => \"1\")\n    end\n\n    it \"routes to #destroy\" do\n      expect(:delete => \"/devices/1\").to route_to(\"devices#destroy\", :id => \"1\")\n    end\n\n  end\nend\n"
  },
  {
    "path": "spec/routing/section_templates_routing_spec.rb",
    "content": "require \"rails_helper\"\n\nRSpec.describe SectionTemplatesController, type: :routing do\n  describe \"routing\" do\n\n    it \"routes to #index\" do\n      expect(:get => \"/section_templates\").to route_to(\"section_templates#index\")\n    end\n\n    it \"routes to #new\" do\n      expect(:get => \"/section_templates/new\").to route_to(\"section_templates#new\")\n    end\n\n    it \"routes to #show\" do\n      expect(:get => \"/section_templates/1\").to route_to(\"section_templates#show\", :id => \"1\")\n    end\n\n    it \"routes to #edit\" do\n      expect(:get => \"/section_templates/1/edit\").to route_to(\"section_templates#edit\", :id => \"1\")\n    end\n\n    it \"routes to #create\" do\n      expect(:post => \"/section_templates\").to route_to(\"section_templates#create\")\n    end\n\n    it \"routes to #update via PUT\" do\n      expect(:put => \"/section_templates/1\").to route_to(\"section_templates#update\", :id => \"1\")\n    end\n\n    it \"routes to #update via PATCH\" do\n      expect(:patch => \"/section_templates/1\").to route_to(\"section_templates#update\", :id => \"1\")\n    end\n\n    it \"routes to #destroy\" do\n      expect(:delete => \"/section_templates/1\").to route_to(\"section_templates#destroy\", :id => \"1\")\n    end\n\n  end\nend\n"
  },
  {
    "path": "spec/routing/sections_routing_spec.rb",
    "content": "require \"rails_helper\"\n\nRSpec.describe SectionsController, type: :routing do\n  describe \"routing\" do\n\n    it \"routes to #index\" do\n      expect(:get => \"/sections\").to route_to(\"sections#index\")\n    end\n\n    it \"routes to #new\" do\n      expect(:get => \"/sections/new\").to route_to(\"sections#new\")\n    end\n\n    it \"routes to #show\" do\n      expect(:get => \"/sections/1\").to route_to(\"sections#show\", :id => \"1\")\n    end\n\n    it \"routes to #edit\" do\n      expect(:get => \"/sections/1/edit\").to route_to(\"sections#edit\", :id => \"1\")\n    end\n\n    it \"routes to #create\" do\n      expect(:post => \"/sections\").to route_to(\"sections#create\")\n    end\n\n    it \"routes to #update via PUT\" do\n      expect(:put => \"/sections/1\").to route_to(\"sections#update\", :id => \"1\")\n    end\n\n    it \"routes to #update via PATCH\" do\n      expect(:patch => \"/sections/1\").to route_to(\"sections#update\", :id => \"1\")\n    end\n\n    it \"routes to #destroy\" do\n      expect(:delete => \"/sections/1\").to route_to(\"sections#destroy\", :id => \"1\")\n    end\n\n  end\nend\n"
  },
  {
    "path": "spec/routing/units_routing_spec.rb",
    "content": "require \"rails_helper\"\n\nRSpec.describe UnitsController, type: :routing do\n  describe \"routing\" do\n\n    it \"routes to #index\" do\n      expect(:get => \"/units\").to route_to(\"units#index\")\n    end\n\n    it \"routes to #new\" do\n      expect(:get => \"/units/new\").to route_to(\"units#new\")\n    end\n\n    it \"routes to #show\" do\n      expect(:get => \"/units/1\").to route_to(\"units#show\", :id => \"1\")\n    end\n\n    it \"routes to #edit\" do\n      expect(:get => \"/units/1/edit\").to route_to(\"units#edit\", :id => \"1\")\n    end\n\n    it \"routes to #create\" do\n      expect(:post => \"/units\").to route_to(\"units#create\")\n    end\n\n    it \"routes to #update via PUT\" do\n      expect(:put => \"/units/1\").to route_to(\"units#update\", :id => \"1\")\n    end\n\n    it \"routes to #update via PATCH\" do\n      expect(:patch => \"/units/1\").to route_to(\"units#update\", :id => \"1\")\n    end\n\n    it \"routes to #destroy\" do\n      expect(:delete => \"/units/1\").to route_to(\"units#destroy\", :id => \"1\")\n    end\n\n  end\nend\n"
  },
  {
    "path": "spec/spec_helper.rb",
    "content": "# This file was generated by the `rails generate rspec:install` command. Conventionally, all\n# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.\n# The generated `.rspec` file contains `--require spec_helper` which will cause\n# this file to always be loaded, without a need to explicitly require it in any\n# files.\n#\n# Given that it is always loaded, you are encouraged to keep this file as\n# light-weight as possible. Requiring heavyweight dependencies from this file\n# will add to the boot time of your test suite on EVERY test run, even for an\n# individual file that may not need all of that loaded. Instead, consider making\n# a separate helper file that requires the additional dependencies and performs\n# the additional setup, and require it from the spec files that actually need\n# it.\n#\n# The `.rspec` file also contains a few flags that are not defaults but that\n# users commonly want.\n#\n# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration\nRSpec.configure do |config|\n  # rspec-expectations config goes here. You can use an alternate\n  # assertion/expectation library such as wrong or the stdlib/minitest\n  # assertions if you prefer.\n  config.expect_with :rspec do |expectations|\n    # This option will default to `true` in RSpec 4. It makes the `description`\n    # and `failure_message` of custom matchers include text for helper methods\n    # defined using `chain`, e.g.:\n    #     be_bigger_than(2).and_smaller_than(4).description\n    #     # => \"be bigger than 2 and smaller than 4\"\n    # ...rather than:\n    #     # => \"be bigger than 2\"\n    expectations.include_chain_clauses_in_custom_matcher_descriptions = true\n  end\n\n  # rspec-mocks config goes here. You can use an alternate test double\n  # library (such as bogus or mocha) by changing the `mock_with` option here.\n  config.mock_with :rspec do |mocks|\n    # Prevents you from mocking or stubbing a method that does not exist on\n    # a real object. This is generally recommended, and will default to\n    # `true` in RSpec 4.\n    mocks.verify_partial_doubles = true\n  end\n\n# The settings below are suggested to provide a good initial experience\n# with RSpec, but feel free to customize to your heart's content.\n=begin\n  # These two settings work together to allow you to limit a spec run\n  # to individual examples or groups you care about by tagging them with\n  # `:focus` metadata. When nothing is tagged with `:focus`, all examples\n  # get run.\n  config.filter_run :focus\n  config.run_all_when_everything_filtered = true\n\n  # Allows RSpec to persist some state between runs in order to support\n  # the `--only-failures` and `--next-failure` CLI options. We recommend\n  # you configure your source control system to ignore this file.\n  config.example_status_persistence_file_path = \"spec/examples.txt\"\n\n  # Limits the available syntax to the non-monkey patched syntax that is\n  # recommended. For more details, see:\n  #   - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/\n  #   - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/\n  #   - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode\n  config.disable_monkey_patching!\n\n  # Many RSpec users commonly either run the entire suite or an individual\n  # file, and it's useful to allow more verbose output when running an\n  # individual spec file.\n  if config.files_to_run.one?\n    # Use the documentation formatter for detailed output,\n    # unless a formatter has already been configured\n    # (e.g. via a command-line flag).\n    config.default_formatter = 'doc'\n  end\n\n  # Print the 10 slowest examples and example groups at the\n  # end of the spec run, to help surface which specs are running\n  # particularly slow.\n  config.profile_examples = 10\n\n  # Run specs in random order to surface order dependencies. If you find an\n  # order dependency and want to debug it, you can fix the order by providing\n  # the seed, which is printed after each run.\n  #     --seed 1234\n  config.order = :random\n\n  # Seed global randomization in this process using the `--seed` CLI option.\n  # Setting this allows you to use `--seed` to deterministically reproduce\n  # test failures related to randomization by passing the same `--seed` value\n  # as the one that triggered the failure.\n  Kernel.srand config.seed\n=end\nend\n"
  },
  {
    "path": "spec/views/captures/edit.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"captures/edit\", type: :view do\nend\n"
  },
  {
    "path": "spec/views/captures/index.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"captures/index\", type: :view do\nend\n"
  },
  {
    "path": "spec/views/captures/new.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"captures/new\", type: :view do\nend\n"
  },
  {
    "path": "spec/views/captures/show.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"captures/show\", type: :view do\nend\n"
  },
  {
    "path": "spec/views/devices/edit.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"devices/edit\", type: :view do\n  before(:each) do\n    @device = assign(:device, Device.create!(\n      :fcc_id => \"MyString\",\n      :baudrate => \"MyString\",\n      :frequency => 1.5,\n      :modulation => \"MyString\",\n      :encoding => \"MyString\",\n      :name => \"MyString\",\n      :notes => \"MyText\"\n    ))\n  end\n\n  it \"renders the edit device form\" do\n    render\n\n    assert_select \"form[action=?][method=?]\", device_path(@device), \"post\" do\n\n      assert_select \"input#device_fcc_id[name=?]\", \"device[fcc_id]\"\n\n      assert_select \"input#device_baudrate[name=?]\", \"device[baudrate]\"\n\n      assert_select \"input#device_frequency[name=?]\", \"device[frequency]\"\n\n      assert_select \"input#device_modulation[name=?]\", \"device[modulation]\"\n\n      assert_select \"input#device_encoding[name=?]\", \"device[encoding]\"\n\n      assert_select \"input#device_name[name=?]\", \"device[name]\"\n\n      assert_select \"textarea#device_notes[name=?]\", \"device[notes]\"\n    end\n  end\nend\n"
  },
  {
    "path": "spec/views/devices/index.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"devices/index\", type: :view do\n  before(:each) do\n    assign(:devices, [\n      Device.create!(\n        :fcc_id => \"Fcc\",\n        :baudrate => \"Baudrate\",\n        :frequency => 1.5,\n        :modulation => \"Modulation\",\n        :encoding => \"Encoding\",\n        :name => \"Name\",\n        :notes => \"MyText\"\n      ),\n      Device.create!(\n        :fcc_id => \"Fcc\",\n        :baudrate => \"Baudrate\",\n        :frequency => 1.5,\n        :modulation => \"Modulation\",\n        :encoding => \"Encoding\",\n        :name => \"Name\",\n        :notes => \"MyText\"\n      )\n    ])\n  end\n\n  it \"renders a list of devices\" do\n    render\n    assert_select \"tr>td\", :text => \"Fcc\".to_s, :count => 2\n    assert_select \"tr>td\", :text => \"Baudrate\".to_s, :count => 2\n    assert_select \"tr>td\", :text => 1.5.to_s, :count => 2\n    assert_select \"tr>td\", :text => \"Modulation\".to_s, :count => 2\n    assert_select \"tr>td\", :text => \"Encoding\".to_s, :count => 2\n    assert_select \"tr>td\", :text => \"Name\".to_s, :count => 2\n    assert_select \"tr>td\", :text => \"MyText\".to_s, :count => 2\n  end\nend\n"
  },
  {
    "path": "spec/views/devices/new.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"devices/new\", type: :view do\n  before(:each) do\n    assign(:device, Device.new(\n      :fcc_id => \"MyString\",\n      :baudrate => \"MyString\",\n      :frequency => 1.5,\n      :modulation => \"MyString\",\n      :encoding => \"MyString\",\n      :name => \"MyString\",\n      :notes => \"MyText\"\n    ))\n  end\n\n  it \"renders new device form\" do\n    render\n\n    assert_select \"form[action=?][method=?]\", devices_path, \"post\" do\n\n      assert_select \"input#device_fcc_id[name=?]\", \"device[fcc_id]\"\n\n      assert_select \"input#device_baudrate[name=?]\", \"device[baudrate]\"\n\n      assert_select \"input#device_frequency[name=?]\", \"device[frequency]\"\n\n      assert_select \"input#device_modulation[name=?]\", \"device[modulation]\"\n\n      assert_select \"input#device_encoding[name=?]\", \"device[encoding]\"\n\n      assert_select \"input#device_name[name=?]\", \"device[name]\"\n\n      assert_select \"textarea#device_notes[name=?]\", \"device[notes]\"\n    end\n  end\nend\n"
  },
  {
    "path": "spec/views/devices/show.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"devices/show\", type: :view do\nend\n"
  },
  {
    "path": "spec/views/section_templates/edit.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"section_templates/edit\", type: :view do\nend\n"
  },
  {
    "path": "spec/views/section_templates/index.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"section_templates/index\", type: :view do\n  before(:each) do\n    assign(:section_templates, [\n      SectionTemplate.create!(\n        :name => \"Name\",\n        :sections => \"MyText\",\n        :added_by => \"Added By\"\n      ),\n      SectionTemplate.create!(\n        :name => \"Name\",\n        :sections => \"MyText\",\n        :added_by => \"Added By\"\n      )\n    ])\n  end\n\n  it \"renders a list of section_templates\" do\n    render\n    assert_select \"tr>td\", :text => \"Name\".to_s, :count => 2\n    assert_select \"tr>td\", :text => \"MyText\".to_s, :count => 2\n    assert_select \"tr>td\", :text => \"Added By\".to_s, :count => 2\n  end\nend\n"
  },
  {
    "path": "spec/views/section_templates/new.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"section_templates/new\", type: :view do\nend\n"
  },
  {
    "path": "spec/views/section_templates/show.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"section_templates/show\", type: :view do\n  before(:each) do\n    @section_template = assign(:section_template, SectionTemplate.create!(\n      :name => \"Name\",\n      :sections => \"MyText\",\n      :added_by => \"Added By\"\n    ))\n  end\n\n  it \"renders attributes in <p>\" do\n    render\n    expect(rendered).to match(/Name/)\n    expect(rendered).to match(/MyText/)\n    expect(rendered).to match(/Added By/)\n  end\nend\n"
  },
  {
    "path": "spec/views/sections/edit.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"sections/edit\", type: :view do\nend\n"
  },
  {
    "path": "spec/views/sections/index.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"sections/index\", type: :view do\nend\n"
  },
  {
    "path": "spec/views/sections/new.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"sections/new\", type: :view do\nend\n"
  },
  {
    "path": "spec/views/sections/show.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"sections/show\", type: :view do\nend\n"
  },
  {
    "path": "spec/views/units/edit.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"units/edit\", type: :view do\nend\n"
  },
  {
    "path": "spec/views/units/index.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"units/index\", type: :view do\nend\n"
  },
  {
    "path": "spec/views/units/new.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"units/new\", type: :view do\nend\n"
  },
  {
    "path": "spec/views/units/show.html.haml_spec.rb",
    "content": "require 'rails_helper'\n\nRSpec.describe \"units/show\", type: :view do\nend\n"
  },
  {
    "path": "test/controllers/.keep",
    "content": ""
  },
  {
    "path": "test/fixtures/.keep",
    "content": ""
  },
  {
    "path": "test/helpers/.keep",
    "content": ""
  },
  {
    "path": "test/integration/.keep",
    "content": ""
  },
  {
    "path": "test/mailers/.keep",
    "content": ""
  },
  {
    "path": "test/models/.keep",
    "content": ""
  },
  {
    "path": "test/test_helper.rb",
    "content": "ENV['RAILS_ENV'] ||= 'test'\nrequire File.expand_path('../../config/environment', __FILE__)\nrequire 'rails/test_help'\n\nclass ActiveSupport::TestCase\n  # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.\n  fixtures :all\n\n  # Add more helper methods to be used by all tests here...\nend\n"
  },
  {
    "path": "vendor/assets/javascripts/.keep",
    "content": ""
  },
  {
    "path": "vendor/assets/stylesheets/.keep",
    "content": ""
  }
]