Code Monkey home page Code Monkey logo

mongoid_shortener's Introduction

Hi there ๐Ÿ‘‹

mongoid_shortener's People

Contributors

parasharrk avatar siong1987 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mongoid_shortener's Issues

Issues

I am getting 2 errors:

when running MongoidShortener.generate("http://google.com")
Error returned:

ArgumentError: The provided regular expression is using multiline anchors (^ or $), which may present a security risk. Did you mean to use \A and \z, or forgot to add the :multiline => true option?

When running shortened_url("http://google.com")
Error Returned:

NoMethodError: undefined method `shortened_url' for main:Object

Rails 5.0.2
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin16]

NoMethodError: undefined method `attr_accessible' for MongoidShortener::ShortenedUrl:Class

$ rails c
Loading development environment (Rails 4.1.8)
2.1.2 :001 > MongoidShortener.generate("http://google.com")
NoMethodError: undefined method attr_accessible' for MongoidShortener::ShortenedUrl:Class from /home/work/osp/mongoid_shortener/app/models/mongoid_shortener/shortened_url.rb:26:inclass:ShortenedUrl'
from /home/work/osp/mongoid_shortener/app/models/mongoid_shortener/shortened_url.rb:2:in <module:MongoidShortener>' from /home/work/osp/mongoid_shortener/app/models/mongoid_shortener/shortened_url.rb:1:in<top (required)>'
from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:443:in load' from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:443:inblock in load_file'
from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:633:in new_constants_in' from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:442:inload_file'
from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:342:in require_or_load' from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:480:inload_missing_constant'
from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:180:in const_missing' from /home/work/osp/mongoid_shortener/lib/mongoid_shortener.rb:10:ingenerate'
from (irb):1
from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/railties-4.1.8/lib/rails/commands/console.rb:90:in start' from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/railties-4.1.8/lib/rails/commands/console.rb:9:instart'
from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:69:in console' from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:40:inrun_command!'
from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/railties-4.1.8/lib/rails/commands.rb:17:in <top (required)>' from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:inrequire'
from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in block in require' from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:232:inload_dependency'
from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in require' from /home/work/sntq/say_no_to_q/bin/rails:8:in<top (required)>'
from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:241:in load' from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:241:inblock in load'
from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:232:in load_dependency' from /home/.rvm/gems/ruby-2.1.2@say_no_to_q/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:241:inload'
from /home/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require' from /home/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire'

Please give credit where credit is due

Hi @siong1987

I was pleased to discover this gem today when playing on the internet. I note that it is clearly derived from my own Shortener gem (https://github.com/jpmcgrath/shortener). I'm really pleased that you were able to put my code to good use, that's the whole point of sharing it.

I see that you have made some good improvements to the code, great stuff!

However, I would really appreciate it if you could replace my name in the copyright notice and mention that your gem is derived from my gem. This is considered polite behaviour in the open source community. Removing my name from the copyright notice in the license file is also specifically prohibited by the license. I don't mind you placing your own name in there as well, you deserve to as you have made significant modifications to your version, but my name should not have been removed.

Cheers,

James.

ArgumentError: The provided regular expression is using multiline anchors (^ or $), which may present a security risk. Did you mean to use \A and \z, or forgot to add the :multiline => true option?

$ rails c
Loading development environment (Rails 4.1.8)
2.1.2 :001 > MongoidShortener.generate("http://google.com")
ArgumentError: The provided regular expression is using multiline anchors (^ or $), which may present a security risk. Did you mean to use \A and \z, or forgot to add the :multiline => true option?
from /home/.rvm/gems/ruby-2.1.2@app/gems/activemodel-4.1.8/lib/active_model/validations/format.rb:39:in check_options_validity' from /home/.rvm/gems/ruby-2.1.2@app/gems/activemodel-4.1.8/lib/active_model/validations/format.rb:20:incheck_validity!'
from /home/.rvm/gems/ruby-2.1.2@app/gems/activemodel-4.1.8/lib/active_model/validator.rb:157:in initialize' from /home/.rvm/gems/ruby-2.1.2@app/gems/activemodel-4.1.8/lib/active_model/validations/with.rb:89:innew'
from /home/.rvm/gems/ruby-2.1.2@app/gems/activemodel-4.1.8/lib/active_model/validations/with.rb:89:in block in validates_with' from /home/.rvm/gems/ruby-2.1.2@app/gems/activemodel-4.1.8/lib/active_model/validations/with.rb:88:ineach'
from /home/.rvm/gems/ruby-2.1.2@app/gems/activemodel-4.1.8/lib/active_model/validations/with.rb:88:in validates_with' from /home/.rvm/gems/ruby-2.1.2@app/gems/mongoid-4.0.0/lib/mongoid/validatable.rb:163:invalidates_with'
from /home/.rvm/gems/ruby-2.1.2@app/gems/mongoid-4.0.0/lib/mongoid/validatable/macros.rb:56:in validates_format_of' from /home/.rvm/gems/ruby-2.1.2@app/gems/mongoid_shortener-1.1.0/app/models/mongoid_shortener/shortened_url.rb:18:inclass:ShortenedUrl'
from /home/.rvm/gems/ruby-2.1.2@app/gems/mongoid_shortener-1.1.0/app/models/mongoid_shortener/shortened_url.rb:2:in <module:MongoidShortener>' from /home/.rvm/gems/ruby-2.1.2@app/gems/mongoid_shortener-1.1.0/app/models/mongoid_shortener/shortened_url.rb:1:in<top (required)>'
from /home/.rvm/gems/ruby-2.1.2@app/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:443:in load' from /home/.rvm/gems/ruby-2.1.2@app/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:443:inblock in load_file'
from /home/.rvm/gems/ruby-2.1.2@app/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:633:in new_constants_in' from /home/.rvm/gems/ruby-2.1.2@app/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:442:inload_file'
... 6 levels...
from /home/.rvm/gems/ruby-2.1.2@app/gems/railties-4.1.8/lib/rails/commands/console.rb:9:in start' from /home/.rvm/gems/ruby-2.1.2@app/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:69:inconsole'
from /home/.rvm/gems/ruby-2.1.2@app/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:40:in run_command!' from /home/.rvm/gems/ruby-2.1.2@app/gems/railties-4.1.8/lib/rails/commands.rb:17:in<top (required)>'
from /home/.rvm/gems/ruby-2.1.2@app/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in require' from /home/.rvm/gems/ruby-2.1.2@app/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:inblock in require'
from /home/.rvm/gems/ruby-2.1.2@app/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:232:in load_dependency' from /home/.rvm/gems/ruby-2.1.2@app/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:inrequire'
from /home/work/sntq/say_no_to_q/bin/rails:8:in <top (required)>' from /home/.rvm/gems/ruby-2.1.2@app/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:241:inload'
from /home/.rvm/gems/ruby-2.1.2@app/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:241:in block in load' from /home/.rvm/gems/ruby-2.1.2@app/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:232:inload_dependency'
from /home/.rvm/gems/ruby-2.1.2@app/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:241:in load' from /home/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /home/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.