From 61ec7f823440ab4a7b0ce397d6f14c814cdb6a12 Mon Sep 17 00:00:00 2001 From: Becca Smith Date: Thu, 6 Jul 2017 00:38:47 +0000 Subject: [PATCH 1/4] word-character-and-no-space-char --- app/controllers/calculations_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/calculations_controller.rb b/app/controllers/calculations_controller.rb index 0df2d0f..dcea842 100644 --- a/app/controllers/calculations_controller.rb +++ b/app/controllers/calculations_controller.rb @@ -11,13 +11,13 @@ def word_count # ================================================================================ - @word_count = "Replace this string with your answer." + @word_count = @text.split.count - @character_count_with_spaces = "Replace this string with your answer." + @character_count_with_spaces = @text.length - @character_count_without_spaces = "Replace this string with your answer." + @character_count_without_spaces = @text.gsub(/\s+/,"").length - @occurrences = "Replace this string with your answer." + @occurrences = # ================================================================================ # Your code goes above. From d8611cf2fb30cc0b64cbc2e9676f6c112e0c4cce Mon Sep 17 00:00:00 2001 From: Becca Smith Date: Thu, 6 Jul 2017 00:59:25 +0000 Subject: [PATCH 2/4] word-character-and-no-space-char --- Gemfile | 3 +++ Gemfile.lock | 8 ++++++++ app/assets/javascripts/application.js | 8 ++++++++ 3 files changed, 19 insertions(+) diff --git a/Gemfile b/Gemfile index b625ba3..86f60d3 100644 --- a/Gemfile +++ b/Gemfile @@ -5,6 +5,9 @@ git_source(:github) do |repo_name| "https://github.com/#{repo_name}.git" end +gem 'momentjs-rails' +gem 'bootstrap3-datetimepicker-rails' +gem 'chronic' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.1.2' diff --git a/Gemfile.lock b/Gemfile.lock index a4b753b..d911ad9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -75,6 +75,8 @@ GEM bootstrap (4.0.0.alpha6) autoprefixer-rails (>= 6.0.3) sass (>= 3.4.19) + bootstrap3-datetimepicker-rails (4.17.47) + momentjs-rails (>= 2.8.1) builder (3.2.3) byebug (9.0.6) callsite (0.0.11) @@ -85,6 +87,7 @@ GEM rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (~> 2.0) + chronic (0.10.2) coderay (1.1.1) concurrent-ruby (1.0.5) crack (0.4.3) @@ -140,6 +143,8 @@ GEM mime-types-data (3.2016.0521) mini_portile2 (2.2.0) minitest (5.10.2) + momentjs-rails (2.17.1) + railties (>= 3.1) multi_json (1.12.1) nio4r (2.1.0) nokogiri (1.8.0) @@ -262,8 +267,10 @@ DEPENDENCIES better_errors binding_of_caller bootstrap (~> 4.0.0.alpha6) + bootstrap3-datetimepicker-rails byebug capybara + chronic dotenv-rails factory_girl_rails firstdraft_generators @@ -274,6 +281,7 @@ DEPENDENCIES letter_opener listen (>= 3.0.5, < 3.2) meta_request + momentjs-rails pry-rails puma (~> 3.7) rails (~> 5.1.2) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 739c2fe..7cb6d38 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -14,3 +14,11 @@ //= require bootstrap //= require turbolinks //= require_tree . + +//= require jquery +//= require moment +//= require bootstrap-datetimepicker + +$(function () { + $('.datetimepicker').datetimepicker(); +}); From 447586b383aefaffc0c333e2a8257d5e4aa692c3 Mon Sep 17 00:00:00 2001 From: Becca Smith Date: Thu, 6 Jul 2017 01:42:58 +0000 Subject: [PATCH 3/4] HELLO --- app/controllers/calculations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/calculations_controller.rb b/app/controllers/calculations_controller.rb index dcea842..842c4b5 100644 --- a/app/controllers/calculations_controller.rb +++ b/app/controllers/calculations_controller.rb @@ -17,7 +17,7 @@ def word_count @character_count_without_spaces = @text.gsub(/\s+/,"").length - @occurrences = + @occurrences = "HELLO" # ================================================================================ # Your code goes above. From 420074424a7849d679c64ed5c8514baa8a636a4c Mon Sep 17 00:00:00 2001 From: Becca Smith Date: Fri, 7 Jul 2017 23:53:35 +0000 Subject: [PATCH 4/4] word-character-and-no-space-char --- app/controllers/calculations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/calculations_controller.rb b/app/controllers/calculations_controller.rb index 842c4b5..fe718a4 100644 --- a/app/controllers/calculations_controller.rb +++ b/app/controllers/calculations_controller.rb @@ -17,7 +17,7 @@ def word_count @character_count_without_spaces = @text.gsub(/\s+/,"").length - @occurrences = "HELLO" + @occurrences = "HELLO you" # ================================================================================ # Your code goes above.